From 04a89118bce0f07522fe8b5e9416a1db991ad443 Mon Sep 17 00:00:00 2001 From: Alex Blank Date: Thu, 13 Aug 2026 15:45:58 +0200 Subject: [PATCH] fix(noctalia): suspend laptops only on battery Require UPower to confirm battery operation before the idle timeout locks and suspends the laptop. --- .config/noctalia/90-machine.toml##class.arch_laptop | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.config/noctalia/90-machine.toml##class.arch_laptop b/.config/noctalia/90-machine.toml##class.arch_laptop index 522fc06..802a381 100644 --- a/.config/noctalia/90-machine.toml##class.arch_laptop +++ b/.config/noctalia/90-machine.toml##class.arch_laptop @@ -77,6 +77,11 @@ type = "alex/system-status:battery-rate" [widget.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] sidebar = "full" sidebar_section = "full"