From e3e82df7e40b4716c2f81d7a65d4cbb95fe51eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Sat, 3 May 2025 15:39:13 +0100 Subject: feat(roles/_workstation): suspend role for user --- .../_workstation/sleep/templates/user-sleep@.service.j2 | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 roles/_workstation/sleep/templates/user-sleep@.service.j2 (limited to 'roles/_workstation/sleep/templates/user-sleep@.service.j2') diff --git a/roles/_workstation/sleep/templates/user-sleep@.service.j2 b/roles/_workstation/sleep/templates/user-sleep@.service.j2 new file mode 100644 index 0000000..34d404d --- /dev/null +++ b/roles/_workstation/sleep/templates/user-sleep@.service.j2 @@ -0,0 +1,17 @@ +# managed by Ansible + +[Unit] +Description=sleep.target of a systemd user session +Before=suspend.target sleep.target hibernate.target +StopWhenUnneeded=yes + +[Service] +Type=oneshot +ExecStart=/usr/bin/systemctl --user start suspend.target +ExecStop=/usr/bin/systemctl --user stop suspend.target +User=%I +Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/%I/bus +RemainAfterExit=yes + +[Install] +WantedBy=suspend.target sleep.target hibernate.target -- cgit v1.2.3