diff options
Diffstat (limited to 'dot_config/systemd/user')
| -rw-r--r-- | dot_config/systemd/user/zellij-inhibit-suspend.path | 12 | ||||
| -rw-r--r-- | dot_config/systemd/user/zellij-inhibit-suspend.service | 19 |
2 files changed, 31 insertions, 0 deletions
diff --git a/dot_config/systemd/user/zellij-inhibit-suspend.path b/dot_config/systemd/user/zellij-inhibit-suspend.path new file mode 100644 index 0000000..72c509c --- /dev/null +++ b/dot_config/systemd/user/zellij-inhibit-suspend.path @@ -0,0 +1,12 @@ +[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. +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 new file mode 100644 index 0000000..9e9ab40 --- /dev/null +++ b/dot_config/systemd/user/zellij-inhibit-suspend.service @@ -0,0 +1,19 @@ +[Unit] +Description=Hold a systemd-inhibit lock while zellij sessions exist +Documentation=man:systemd-inhibit(1) man:zellij(1) +# Independent of any graphical session: this is meant to run on +# headless SSH-attached hosts too. + +[Service] +Type=simple +ExecStart=systemd-inhibit \ + --what=sleep:idle:handle-lid-switch \ + --who=zellij \ + --why=Active\x20zellij\x20sessions \ + --mode=block \ + %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 |
