nixos/system/home/scripts/shell/low-battery.sh
Evie Litherland-Smith f17c2cb5a6 Add low-battery notification script
Add acpi to laptop.nix for low-battery script
2024-09-18 07:27:22 +01:00

5 lines
172 B
Bash

battery_level=$(acpi -b | grep -P -o '[0-9]+(?=%)')
if [ "$battery_level" -le 20 ]; then
notify-send -u critical "Battery low" "Battery level is ${battery_level}%!"
fi