Created
July 14, 2015 21:04
-
-
Save giuscri/b287f28cbd7580047b66 to your computer and use it in GitHub Desktop.
.checklowbattery
This file contains hidden or 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
#!/usr/bin/sh | |
BATTERYLEVEL=$(acpi -b|sed -r "s/^.* ([0-9]{1,3})%, .*$/\1/g"); | |
DISCHARGING=$(acpi -b|egrep 'Discharging'); | |
if [[ $BATTERYLEVEL -lt 100 && $DISCHARGING ]]; then | |
notify-send --urgency=critical --expire-time=5000 "!, close to fucked up baby. $BATTERYLEVEL%." \ | |
"You've a bunch of minutes left to commit everything and put your <b>wonderful</b> laptop @ zzz." | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment