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.
12345678910111213 |
- #!/bin/sh
-
- while true; do
- acpi | grep Discharging
- if [ "$?" -eq 0 ]; then
- battery_level=`acpi -b | grep -P -o '[0-9]+(?=%)'`
- if [ $battery_level -le 5 ]; then
- notify-send "Battery low" "Battery level is ${battery_level}%!"
- sleep 300
- fi
- fi
- sleep 60
- done
|