From d4623615f30007193a724b95c1482dba4cf9ed8c Mon Sep 17 00:00:00 2001 From: 0scar Date: Thu, 8 Jul 2021 15:44:41 +0200 Subject: Add autolock service unit file --- etc/systemd/system/autolock@.service | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 etc/systemd/system/autolock@.service (limited to 'etc/systemd/system') diff --git a/etc/systemd/system/autolock@.service b/etc/systemd/system/autolock@.service new file mode 100644 index 0000000..806de0d --- /dev/null +++ b/etc/systemd/system/autolock@.service @@ -0,0 +1,13 @@ +# Enable with autolock@ +[Unit] +Description=Lock X session using slock for user %i +Before=sleep.target + +[Service] +User=%i +Environment="DISPLAY=:0" "XAUTHORITY=/home/%i/.config/x/authority" +ExecStartPre=/usr/bin/xset dpms force suspend +ExecStart=/usr/local/bin/slock + +[Install] +WantedBy=sleep.target -- cgit v1.3