Skip to content

Instantly share code, notes, and snippets.

@giuscri
Created July 14, 2015 21:04
Show Gist options
  • Save giuscri/b287f28cbd7580047b66 to your computer and use it in GitHub Desktop.
Save giuscri/b287f28cbd7580047b66 to your computer and use it in GitHub Desktop.
.checklowbattery
#!/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