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.
git clone https://github.com/anuphw/BatteryProtector.git
cd BatteryProtector
python -m venv venv
source venv/bin/activate
pip install telebot
- You need to create a telegram bot
- Find your own chat id
- Change TOKEN and MY_CHAT_ID in the battery_bot.py
python battery_bot.py
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