From b388f332be0cb87675531b5f47322a1b4a80c2c4 Mon Sep 17 00:00:00 2001 From: Samir Benmendil Date: Tue, 31 Oct 2023 22:01:20 +0000 Subject: [PATCH] systemd: add user suspend.target --- systemd/system/suspend@.service | 12 ++++++++++++ systemd/user/suspend.target | 3 +++ 2 files changed, 15 insertions(+) create mode 100644 systemd/system/suspend@.service create mode 100644 systemd/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 -- 2.48.1