diff options
Diffstat (limited to 'dot_config/systemd')
| -rw-r--r-- | dot_config/systemd/user/swayidle.service | 1 | ||||
| -rw-r--r-- | dot_config/systemd/user/zellij-inhibit-suspend.path | 15 | ||||
| -rw-r--r-- | dot_config/systemd/user/zellij-inhibit-suspend.service | 23 |
3 files changed, 1 insertions, 38 deletions
diff --git a/dot_config/systemd/user/swayidle.service b/dot_config/systemd/user/swayidle.service index 478c8f8..acd0196 100644 --- a/dot_config/systemd/user/swayidle.service +++ b/dot_config/systemd/user/swayidle.service @@ -10,6 +10,7 @@ ExecStart=/usr/bin/swayidle -w \ timeout 300 'swaymsg "output * power off"' \ resume 'swaymsg "output * power on"' \ timeout 330 'swaylock -f -e -c 000000' \ + timeout 1800 '%h/.local/bin/on-battery-suspend' \ before-sleep 'playerctl -a pause; swaylock -f -e -c 000000' \ lock 'swaylock -f -e -c 000000' Restart=on-failure diff --git a/dot_config/systemd/user/zellij-inhibit-suspend.path b/dot_config/systemd/user/zellij-inhibit-suspend.path deleted file mode 100644 index 2a4be21..0000000 --- a/dot_config/systemd/user/zellij-inhibit-suspend.path +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=Activate suspend inhibitor whenever zellij has a live session - -[Path] -# %t expands to $XDG_RUNTIME_DIR (typically /run/user/$UID); zellij keeps -# its per-version session sockets under this directory. Whenever the dir -# transitions from empty to non-empty, the service is (re)activated. -# The service's watcher then decides whether to actually hold the lock -# (only if at least one zellij was spawned from an SSH session); if not, -# it exits immediately and the service stops with no harm done. -DirectoryNotEmpty=%t/zellij -Unit=zellij-inhibit-suspend.service - -[Install] -WantedBy=default.target diff --git a/dot_config/systemd/user/zellij-inhibit-suspend.service b/dot_config/systemd/user/zellij-inhibit-suspend.service deleted file mode 100644 index 7c73c64..0000000 --- a/dot_config/systemd/user/zellij-inhibit-suspend.service +++ /dev/null @@ -1,23 +0,0 @@ -[Unit] -Description=Stay alive while any zellij session exists; inhibit suspend if SSH-spawned -Documentation=man:systemd-inhibit(1) man:zellij(1) -# Independent of any graphical session: this is meant to run on -# headless SSH-attached hosts too. The watcher itself decides whether -# the current zellij activity warrants inhibiting (SSH-spawned only), -# and acquires/releases its own systemd-inhibit lock dynamically. It -# stays alive for the whole zellij dir lifetime so the .path unit does -# not retrigger us in a busy loop when only local zellij sessions are -# active. -# Disable systemd's default start-rate limiter: even though the -# refactored watcher should not cycle anymore, a zero rate-limit makes -# this unit resilient if the user kills it manually. -StartLimitIntervalSec=0 - -[Service] -Type=simple -ExecStart=%h/.local/bin/zellij-inhibit-watcher -# Don't auto-restart: the .path unit reactivates us on the next session. -Restart=no - -[Install] -WantedBy=default.target |
