This commit is contained in:
Rachel Lambda Samuelsson 2024-03-14 16:35:36 +01:00
parent f6905d27e8
commit 9cfe373129

View File

@ -626,14 +626,14 @@ in rec {
acpi -b | grep "Battery 0" | awk -F'[,:%]' '{print $2, $3}' | {
read -r status capacity
if [ "$status" = Discharging -a "$capacity" -lt 2 ]; then
if [ "$status" = Discharging -a "$capacity" -le 2 ]; then
dunstify -u critical -a batMon \
-h string:x-dunst-stack-tag:batMon \
-h int:value:"$capacity" "Battery Critical: ''${capacity}%
Hibernating"
sleep 5
systemctl hibernate
elif [ "$status" = Discharging -a "$capacity" -lt 5 ]; then
elif [ "$status" = Discharging -a "$capacity" -le 5 ]; then
dunstify -u critical -a batMon \
-h string:x-dunst-stack-tag:batMon \
-h int:value:"$capacity" "Battery Critical: ''${capacity}%"