Created
June 11, 2015 15:20
-
-
Save xero/6ea24cb35ad2638e1d59 to your computer and use it in GitHub Desktop.
low battery alert cron job
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BATPATH=/sys/class/power_supply/BAT0 | |
BAT_FULL=$BATPATH/charge_full | |
BAT_NOW=$BATPATH/charge_now | |
bf=$(cat $BAT_FULL) | |
bn=$(cat $BAT_NOW) | |
if [ $(( 100 * $bn / $bf )) -lt 15 ] | |
then | |
notify-send "low battery!" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment