Config: Actually lock the screen before going to sleep, using systemd

This commit is contained in:
Riyyi
2022-09-02 15:52:56 +02:00
parent c3811b7f78
commit cf417d95b2
5 changed files with 28 additions and 5 deletions
+19
View File
@@ -0,0 +1,19 @@
# -*- conf -*-
[Unit]
Description=Lock the screen with i3lock
Before=sleep.target
[Service]
User=%I
Type=forking
Environment=DISPLAY=:0
Environment=XDG_CACHE_HOME=/home/%I/.cache
ExecStart=/bin/setsid -f /home/%I/.local/bin/wm/lock.sh
ExecStartPost=/bin/sleep 1
[Install]
WantedBy=sleep.target
# Reference:
# https://wiki.archlinux.org/title/Power_management#Sleep_hooks