summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lamb <lamby@debian.org>2019-08-06 16:07:17 +0100
committerChris Lamb <lamby@debian.org>2019-08-06 16:15:17 +0100
commit3ff283cc5bdda19acb431d9683ee49ac82dcbe70 (patch)
treef08e90cce150e98050461058e0e554cc038ae63a
parent6f5cacebe91078b3806bbed2ec8428bcaaaf3ca1 (diff)
Add an example systemd service file to lock screen on suspend/sleep.
-rw-r--r--debian/xtrlock.examples1
-rw-r--r--xtrlock.service28
2 files changed, 29 insertions, 0 deletions
diff --git a/debian/xtrlock.examples b/debian/xtrlock.examples
new file mode 100644
index 0000000..3d0e946
--- /dev/null
+++ b/debian/xtrlock.examples
@@ -0,0 +1 @@
+xtrlock.service
diff --git a/xtrlock.service b/xtrlock.service
new file mode 100644
index 0000000..58d85de
--- /dev/null
+++ b/xtrlock.service
@@ -0,0 +1,28 @@
+# Example systemd service to lock screen on sleep/suspend
+#
+# To install:
+#
+# * Copy this file to /etc/systemd/system/xtrlock.service
+# * Replace the "FIXME" entries.
+# * Run: sudo systemctl enable xtrlock
+#
+# As user units cannot depend on system units, we cannot provide this via the
+# per-user systemd instance.
+#
+# -- Chris Lamb <lamby@debian.org> Tue, 06 Aug 2019 16:05:59 +0100
+
+[Unit]
+Description=Lock screen
+Requires=network.target
+After=sleep.target
+DefaultDependencies=no
+
+[Service]
+ExecStart=/usr/bin/xtrlock
+User=FIXME
+Group=FIXME
+Environment=DISPLAY=:0
+Type=oneshot
+
+[Install]
+WantedBy=sleep.target