My personal dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

battery_notify 317B

12345678910111213
  1. #!/bin/sh
  2. while true; do
  3. acpi | grep Discharging
  4. if [ "$?" -eq 0 ]; then
  5. battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
  6. if [ $battery_level -le 5 ]; then
  7. notify-send "Battery low" "Battery level is ${battery_level}%!"
  8. sleep 300
  9. fi
  10. fi
  11. sleep 60
  12. done