Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 1.07 KB

README.md

File metadata and controls

40 lines (30 loc) · 1.07 KB

BatteryProtector

Get notification when your laptop battery is almost full or empty

I recently had to change my laptop battery because it was swolen. One of the main reasons for it that I never unplug the charger. So I created a telegram bot to notify me when the battery is almost full or empty.

I created a cronjob that runs the bot script whenever my laptop restarts.

Installation:

git clone https://github.com/anuphw/BatteryProtector.git
cd BatteryProtector
python -m venv venv
source venv/bin/activate
pip install telebot
python battery_bot.py

Set up cronjob

crontab -e

Create a new cronjob like the following

@reboot <path-to-python> <path-to-battery_bot.py>

for example

@reboot /home/anup/BatteryProtector/venv/bin/python /home/anup/BatteryProtector/battery_bot.py