From 8d93ac7e2f5731116ccaf251abcc92edb2d59223 Mon Sep 17 00:00:00 2001 From: Josue Zamudio Date: Thu, 29 Oct 2026 08:44:53 -0700 Subject: [PATCH] feat(idle): suspend after 10 min of lid-open idle The panel powered off at 330s but nothing ever suspended, so a lid-open idle laptop kept drawing 6-7W indefinitely; only lid *close* suspended (logind's default HandleLidSwitch). logind IdleAction stays Ignore on purpose -- it cannot run swaymsg/hyprlock hooks, hypridle's before_sleep_cmd can. Plain suspend, not suspend-then-hibernate: swap is zram-only. --- .config/hypr/hypridle.conf | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.config/hypr/hypridle.conf b/.config/hypr/hypridle.conf index 16d1edf..9ee7d5e 100644 --- a/.config/hypr/hypridle.conf +++ b/.config/hypr/hypridle.conf @@ -46,3 +46,18 @@ listener { on-timeout = swaymsg "output * power off" on-resume = swaymsg "output * power on" && brightnessctl -r } +# 10min -> s2idle. This listener used to be missing entirely: the panel powered +# off at 330s but the machine never suspended, so a lid-open idle laptop kept +# draining ~6-7W (10h battery) forever. Closing the lid did suspend, because +# logind's default HandleLidSwitch=suspend -- but only the lid path. +# logind's own IdleAction stays Ignore on purpose (it cannot run swaymsg/hyprlock +# pre-sleep hooks; hypridle's before_sleep_cmd can). +# 600s = long enough that a compile/syncthing burst usually finishes; a suspend +# mid-task is recoverable, and before_sleep_cmd locks on resume. +# Verified: polkit org.freedesktop.login1.suspend allow_active=yes, so this +# needs no auth prompt from an active local session. Plain suspend (not +# suspend-then-hibernate) because swap is zram-only -> hibernate impossible. +listener { + timeout = 600 # 10min -> suspend + on-timeout = systemctl suspend +}