nsbin/battery-check.sh
Nico Schottelius b6aa33509c various updates
2019-12-08 19:28:42 +01:00

18 lines
409 B
Bash
Executable file

#!/bin/sh
acpi=$(acpi)
# Nothing to be done if we are charging
if echo "$acpi" | grep -q Charging; then
exit 0
fi
percent=$(echo $acpi | cut -d, -f2 | sed 's/%//')
if [ $percent -le 10 ]; then
notify-send -u critical "Battery:${percent}%"
elif [ $percent -le 15 ]; then
notify-send -u normal "Battery:${percent}%"
elif [ $percent -le 20 ]; then
notify-send -u low "Battery:${percent}%"
fi