aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--dot_config/sway/config7
-rw-r--r--dot_config/systemd/user/sway-session.target2
-rw-r--r--dot_config/systemd/user/swayidle.service19
-rw-r--r--etc/systemd/logind.conf57
4 files changed, 20 insertions, 65 deletions
diff --git a/dot_config/sway/config b/dot_config/sway/config
index d1357a7..966c6ca 100644
--- a/dot_config/sway/config
+++ b/dot_config/sway/config
@@ -155,10 +155,3 @@ exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CU
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec "sleep 2 && ~/.config/sway/display-toggle.sh init"
exec systemctl --user start sway-session.target
-
-# Idle: lock at 5min (matches IdleActionSec), blank at 6min, lock before sleep.
-exec 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'
diff --git a/dot_config/systemd/user/sway-session.target b/dot_config/systemd/user/sway-session.target
index ba1d37b..db57db4 100644
--- a/dot_config/systemd/user/sway-session.target
+++ b/dot_config/systemd/user/sway-session.target
@@ -2,6 +2,6 @@
Description=sway compositor session
Documentation=man:systemd.special(7)
BindsTo=graphical-session.target
-Wants=graphical-session-pre.target mako.service poweralertd.service display-watcher.service
+Wants=graphical-session-pre.target mako.service poweralertd.service display-watcher.service swayidle.service
After=graphical-session-pre.target
StopWhenUnneeded=yes
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
diff --git a/etc/systemd/logind.conf b/etc/systemd/logind.conf
deleted file mode 100644
index 37c0b1f..0000000
--- a/etc/systemd/logind.conf
+++ /dev/null
@@ -1,57 +0,0 @@
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it under the
-# terms of the GNU Lesser General Public License as published by the Free
-# Software Foundation; either version 2.1 of the License, or (at your option)
-# any later version.
-#
-# Entries in this file show the compile time defaults. Local configuration
-# should be created by either modifying this file (or a copy of it placed in
-# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in
-# the /etc/systemd/logind.conf.d/ directory. The latter is generally
-# recommended. Defaults can be restored by simply deleting the main
-# configuration file and all drop-ins located in /etc/.
-#
-# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config.
-#
-# See logind.conf(5) for details.
-
-[Login]
-#NAutoVTs=6
-#ReserveVT=6
-#KillUserProcesses=no
-#KillOnlyUsers=
-#KillExcludeUsers=root
-#InhibitDelayMaxSec=5
-#UserStopDelaySec=10
-#SleepOperation=suspend-then-hibernate suspend
-#HandlePowerKey=poweroff
-#HandlePowerKeyLongPress=ignore
-#HandleRebootKey=reboot
-#HandleRebootKeyLongPress=poweroff
-#HandleSuspendKey=suspend
-#HandleSuspendKeyLongPress=hibernate
-#HandleHibernateKey=hibernate
-#HandleHibernateKeyLongPress=ignore
-#HandleLidSwitch=suspend
-#HandleLidSwitchExternalPower=suspend
-#HandleLidSwitchDocked=ignore
-#HandleSecureAttentionKey=secure-attention-key
-#PowerKeyIgnoreInhibited=no
-#SuspendKeyIgnoreInhibited=no
-#HibernateKeyIgnoreInhibited=no
-#LidSwitchIgnoreInhibited=yes
-#RebootKeyIgnoreInhibited=no
-#HoldoffTimeoutSec=30s
-#IdleAction=ignore
-IdleAction=lock
-#IdleActionSec=30min
-IdleActionSec=5min
-#RuntimeDirectorySize=10%
-#RuntimeDirectoryInodesMax=
-#RemoveIPC=yes
-#InhibitorsMax=8192
-#SessionsMax=8192
-#StopIdleSessionSec=infinity
-#DesignatedMaintenanceTime=
-#WallMessages=yes