Skip to content

Utility for Mac owners to help keep their batteries in peak health for the maximum amount of time by alerting when not charged and at 20% or less, or, charging at or over 80%. Invoked as a cron job.

License

Notifications You must be signed in to change notification settings

mbarberry/checkbattery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Idea

Batteries last longer when they are kept charged between 20 and 80 percent. This program works on MacOS and will speak alert messages when your (1) not charging and your battery level is at or below 20, (2) are charging and your battery level is at or above 80. You can customize the messages. The first 5 alerts will occur every 30 seconds. All remaining alerts will occur every 10 minutes. (If you don't hear the first 5 it's likely you are away and you may annoy friends or neighbors if your computer keeps speaking.)

Suggested Usage

As a crontab that runs every minute. Use crontab -e to open cron. Modify the example below to use your variables. Default output is ./log/jobs.log that will capture standard output and standard error.

Update the crontab to look like:

SHELL=/bin/bash
*/1 * * * * DIR="<abs-path-to-clone-on-your-system>"; <abs-path-to-node-executable> $DIR/src/index.js <your-take-off-charger-message> <your-charge-message> >> $DIR/log/jobs.log 2>&1

Database

Initialize your database before first usage with node db/init.js from the project root directory.

About

Utility for Mac owners to help keep their batteries in peak health for the maximum amount of time by alerting when not charged and at 20% or less, or, charging at or over 80%. Invoked as a cron job.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published