diff options
| author | 2026-05-13 13:43:36 +0100 | |
|---|---|---|
| committer | 2026-05-13 13:43:36 +0100 | |
| commit | 54662c8b95ce260ad0a8718e14850c96a66242ef (patch) | |
| tree | f1b36d6fd5b9cd15520da5340a724a46086cb608 /dot_config/systemd/user/swayidle.service | |
| parent | d7fac4bbf607a894219065dc9b87f6d495d9ebab (diff) | |
| download | dotfiles-54662c8b95ce260ad0a8718e14850c96a66242ef.tar.gz dotfiles-54662c8b95ce260ad0a8718e14850c96a66242ef.tar.bz2 dotfiles-54662c8b95ce260ad0a8718e14850c96a66242ef.zip | |
refactor(swayidle): drop bespoke post-resume grace script
Replaces the resume-lock-grace.sh + after-resume hook from the previous
commit with the simpler observation that sway already provides a wake
grace for free: it pauses the idle counter during suspend and resets it
on the first input event post-resume, so the existing timeout 300 lock
naturally gives ~5min to interact before locking. Just dropping the
before-sleep lock is enough; the script and after-resume directive were
overcomplicating it.
Diffstat (limited to 'dot_config/systemd/user/swayidle.service')
| -rw-r--r-- | dot_config/systemd/user/swayidle.service | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/dot_config/systemd/user/swayidle.service b/dot_config/systemd/user/swayidle.service index 7f60847..dc84fe5 100644 --- a/dot_config/systemd/user/swayidle.service +++ b/dot_config/systemd/user/swayidle.service @@ -1,22 +1,21 @@ [Unit] -Description=Idle manager for Wayland (lock + DPMS + post-resume grace) +Description=Idle manager for Wayland (lock + DPMS) PartOf=graphical-session.target After=graphical-session.target ConditionEnvironment=WAYLAND_DISPLAY [Service] Type=simple -# We deliberately do NOT lock on `before-sleep`; instead we lock only -# after a grace period post-resume, so a quick wake-and-keep-using -# doesn't require the password. `before-sleep` only pauses media so the -# call/track doesn't run on into suspend. The `lock` action still -# handles explicit `loginctl lock-session` immediately. +# `before-sleep` deliberately only pauses media -- it does not lock. +# sway pauses its idle counter during suspend and resets on the first +# input event after resume, so the existing `timeout 300` already +# gives a 5-minute grace post-wake without a separate mechanism. The +# `lock` action still handles explicit `loginctl lock-session`. ExecStart=/usr/bin/swayidle -w \ timeout 300 'swaylock -f -e -c 282828' \ timeout 360 'swaymsg "output * power off"' \ resume 'swaymsg "output * power on"' \ before-sleep 'playerctl -a pause' \ - after-resume '%h/.config/sway/resume-lock-grace.sh 30' \ lock 'swaylock -f -e -c 282828' Restart=on-failure RestartSec=2s |
