lowbat brightness adjust
All checks were successful
Activate Homelab Configuration / rebuild (push) Successful in 18s

This commit is contained in:
Satria 2026-07-24 15:26:59 +07:00
commit c3d19551ee

View file

@ -19,7 +19,7 @@
echo "`date` battery status:$BAT_STA percentage:$BAT_PCT" echo "`date` battery status:$BAT_STA percentage:$BAT_PCT"
export DISPLAY=:0 export DISPLAY=:0
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus
test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send "Low Battery" "Battery remaining: $BAT_PCT%." test $BAT_PCT -le 30 && test $BAT_PCT -gt 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send "Low Battery" "Battery remaining: $BAT_PCT%." && brightnessctl s 30%
test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send -u critical "Low Battery" "Shutdown at 10%." test $BAT_PCT -le 15 && test $BAT_STA = "Discharging" && ${pkgs.libnotify}/bin/notify-send -u critical "Low Battery" "Shutdown at 10%."
''} > /tmp/cron.batt.log 2>&1" ''} > /tmp/cron.batt.log 2>&1"
]; ];