[Unit] Description=swayidle idle lock (locks via noctalia-shell IPC, suspends on lid) Documentation=https://github.com/swaywm/swayidle After=graphical-session.target # Restart together with the session, not merely at boot: this unit is wanted by # default.target, so a compositor restart used to leave it orphaned while the target came # back without it. Refs #47. PartOf=graphical-session.target # With Restart=always below, a fast failure loop must never wedge the watcher into `failed`: # a lock that keeps trying beats a lock that stopped trying. Refs #47. StartLimitIntervalSec=0 [Service] # Locks via the noctalia v5 shell; `noctalia msg` resolves the running instance # through the D-Bus session bus, so no WAYLAND_DISPLAY pinning is needed in unit context. # deploy.sh enables it only where the ExecStart binary resolves, so it stays inert until swayidle is installed. ExecStart=/usr/bin/swayidle -w \ timeout 300 '/usr/bin/noctalia msg session lock' \ before-sleep '/usr/bin/noctalia msg session lock' \ after-resume '/usr/bin/noctalia msg session lock' # `swayidle -w` exits 0 on SIGTERM, and that is how this watcher died on 2026-10-12: a clean # exit that `Restart=on-failure` cannot see, leaving the box unlocked for a week. A supervisor # restarts always. Refs #47. Restart=always RestartSec=5s [Install] WantedBy=default.target