From: Samir Benmendil Date: Tue, 31 Oct 2023 22:01:20 +0000 (+0000) Subject: systemd: add user suspend.target X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/08dabc2e5793981735b16def05edd9514f4dbff0?ds=inline systemd: add user suspend.target --- diff --git a/systemd/system/suspend@.service b/systemd/system/suspend@.service new file mode 100644 index 0000000..addaeb9 --- /dev/null +++ b/systemd/system/suspend@.service @@ -0,0 +1,12 @@ +# Proxy the system suspend.target to a users suspend.target. Enable with: +# systemctl enable suspend@$(whoami) +[Unit] +Description=Call user's suspend target when system suspends +After=suspend.target + +[Service] +Type=oneshot +ExecStart=/usr/bin/systemctl --user --machine=%i@ start --wait suspend.target + +[Install] +WantedBy=suspend.target diff --git a/systemd/user/suspend.target b/systemd/user/suspend.target new file mode 100644 index 0000000..6aba376 --- /dev/null +++ b/systemd/user/suspend.target @@ -0,0 +1,3 @@ +[Unit] +Description=User suspend target +StopWhenUnneeded=yes