]> git.rmz.io Git - dotfiles.git/blobdiff - systemd/system/suspend@.service
systemd: add user suspend.target
[dotfiles.git] / systemd / system / suspend@.service
diff --git a/systemd/system/suspend@.service b/systemd/system/suspend@.service
new file mode 100644 (file)
index 0000000..addaeb9
--- /dev/null
@@ -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