diff options
| author | 2026-05-29 11:18:13 +0100 | |
|---|---|---|
| committer | 2026-05-29 11:18:13 +0100 | |
| commit | 01df321e907b6c8568bb8622eb44a5c1486a0631 (patch) | |
| tree | bb9d76bf9bddd982fc079e045414e138154fa0ef /systemd-units | |
| parent | 263f39704ae5e8f44a79d64dce2be048009b4df6 (diff) | |
| download | dotfiles-01df321e907b6c8568bb8622eb44a5c1486a0631.tar.gz dotfiles-01df321e907b6c8568bb8622eb44a5c1486a0631.tar.bz2 dotfiles-01df321e907b6c8568bb8622eb44a5c1486a0631.zip | |
feat(suspend): hold inhibit lock while any zellij session exists
The SSH-shell inhibitor in dot_zprofile is bound to the lifetime of the
login shell, so it disappears the moment the user detaches a zellij
session and disconnects — defeating the whole point of using zellij for
persistent remote work.
Add a user-scope path+service+watcher trio that ties the inhibit lock
to the existence of zellij sessions instead:
- dot_local/bin/executable_zellij-inhibit-watcher
Polls `zellij list-sessions --short` every 15s, exits when none
remain. Override poll interval via $ZELLIJ_INHIBIT_POLL.
- dot_config/systemd/user/zellij-inhibit-suspend.service
Wraps the watcher in `systemd-inhibit --what=sleep:idle:handle-lid-switch
--mode=block`. When the watcher exits, the service stops and the
lock is released.
- dot_config/systemd/user/zellij-inhibit-suspend.path
Activates the service whenever $XDG_RUNTIME_DIR/zellij becomes
non-empty (i.e. zellij creates its first session socket). Re-fires
on every empty→non-empty transition.
Enable via systemd-units/user.txt (the .path unit; the service is
on-demand).
The existing SSH-shell inhibitor is kept as a backstop for non-zellij
remote sessions and is now documented as such.
VM (nix/vm.nix) deliberately not updated: the Ubuntu remote-dev VM
never suspends, so the inhibit machinery would be inert there.
Diffstat (limited to 'systemd-units')
| -rw-r--r-- | systemd-units/user.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/systemd-units/user.txt b/systemd-units/user.txt index 009b2b3..77ba788 100644 --- a/systemd-units/user.txt +++ b/systemd-units/user.txt @@ -18,3 +18,9 @@ wob.service # --- mail (overridden via drop-ins in dot_config/systemd/user/) --- protonmail-bridge.service + +# --- suspend inhibitor: keep host awake while any zellij session exists --- +# Enable the .path unit; it activates the service on-demand when zellij's +# socket dir becomes non-empty. The service wraps a poller in +# systemd-inhibit and exits when no sessions remain, releasing the lock. +zellij-inhibit-suspend.path |
