fix(noctalia): suspend laptops only on battery

Require UPower to confirm battery operation before the idle timeout locks and suspends the laptop.
This commit is contained in:
2026-08-13 15:45:58 +02:00
parent f9007e3225
commit 04a89118bc
@@ -77,6 +77,11 @@ type = "alex/system-status:battery-rate"
[widget.gpu-mode] [widget.gpu-mode]
type = "alex/system-status:gpu-mode" type = "alex/system-status:gpu-mode"
# Only suspend-then-hibernate after 30 minutes when UPower confirms battery power.
# The command fails closed on AC or when UPower is unavailable.
[idle.behavior.suspend-then-hibernate]
command = "busctl get-property org.freedesktop.UPower /org/freedesktop/UPower org.freedesktop.UPower OnBattery 2>/dev/null | grep -qx 'b true' && loginctl lock-session && systemctl suspend-then-hibernate"
[control_center] [control_center]
sidebar = "full" sidebar = "full"
sidebar_section = "full" sidebar_section = "full"