Skip to content

For reasons of I want to conserve the battery of my notebook, I created a battery check.

Notifications You must be signed in to change notification settings

Julio-Assis/BatteryTracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

BatteryTracker

For reasons of losing the previous battery of my notebook, I want to try to take more care of my new battery. The first step to do that is to stop charging when the battery level reaches 80%. To do that it was created a BatteryTracker script that sends a notification on Ubuntu if the battery level is above 80% and the notebook is plugged.

First setup the BatteryTracker virtualenv with:

$ virtualenv -p python3 py3env

Then install psutil to do the battery check

source ~/py3env/bin/activate
pip install psutil

With that done all there is left is to set a cronjob to check the battery level every 5 minutes. To set the user cronjob one should open the crontab with:

$ crontab -e

and add the line

*/5 * * * * ~/py3env/bin/python /path/to/BatteryTracker.py

About

For reasons of I want to conserve the battery of my notebook, I created a battery check.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages