5 lines
172 B
Bash
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
|