Skip to content

Instantly share code, notes, and snippets.

@avgerin0s
Created October 14, 2014 19:32
Show Gist options
  • Save avgerin0s/4880fbebdf71ce25d7a7 to your computer and use it in GitHub Desktop.
Save avgerin0s/4880fbebdf71ce25d7a7 to your computer and use it in GitHub Desktop.
Battery notifier for linux
#!/usr/bin/zsh
percentage=`upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "percentage" | awk '{ print $2 }' | cut -c 1-2`
if [ $percentage -lt 10 ]; then
notify-send Battery "$percentage%"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment