From 456aa855b4348a8aa8b4a6679d5edfffdb235452 Mon Sep 17 00:00:00 2001 From: sommerfeld Date: Wed, 13 May 2026 13:43:11 +0100 Subject: refactor(sway): manage swayidle as a user unit; drop logind override - New dot_config/systemd/user/swayidle.service, pulled in by sway-session.target alongside mako/display-watcher/poweralertd. Same lifetime as the rest of the session: starts after graphical-session, restarts on failure, stops on logout. - Drop the swayidle exec from sway config (was unmanaged background process with no restart, no logging hookup). - Revert etc/systemd/logind.conf overrides: swayidle handles idle-lock directly via Wayland ext-idle-notifier, so the logind IdleAction belt-and-suspenders is redundant. Run just etc-reset /etc/systemd/logind.conf on the host to restore pristine. --- dot_config/systemd/user/swayidle.service | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dot_config/systemd/user/swayidle.service (limited to 'dot_config/systemd/user/swayidle.service') diff --git a/dot_config/systemd/user/swayidle.service b/dot_config/systemd/user/swayidle.service new file mode 100644 index 0000000..8a99bfb --- /dev/null +++ b/dot_config/systemd/user/swayidle.service @@ -0,0 +1,19 @@ +[Unit] +Description=Idle manager for Wayland (lock + DPMS + before-sleep) +PartOf=graphical-session.target +After=graphical-session.target +ConditionEnvironment=WAYLAND_DISPLAY + +[Service] +Type=simple +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; swaylock -f -e -c 282828' \ + lock 'swaylock -f -e -c 282828' +Restart=on-failure +RestartSec=2s + +[Install] +WantedBy=sway-session.target -- cgit v1.3.1