Add hibernate to battery script at less than 5%

This commit is contained in:
2025-05-08 23:59:30 +01:00
parent f3c219badc
commit 536e1b3a68

View File

@@ -22,8 +22,13 @@ else
elif [[ $capacity -ge 10 ]] elif [[ $capacity -ge 10 ]]
then then
status="" status=""
elif [[ $capacity -gt 5 ]]
then
notify-send -u critical "Charge now! (will hibernate at 5%)"
status=""
else else
notify-send -u critical "Charge now!" notify-send -u critical "Hibernating..."
systemctl hibernate
status="" status=""
fi fi
echo "$status $capacity% $time_left" echo "$status $capacity% $time_left"