Skip to content

Instantly share code, notes, and snippets.

@T4cC0re
Last active January 17, 2021 19:32
Show Gist options
  • Save T4cC0re/9f6350717051ac122c5a2e3e0ec7a37a to your computer and use it in GitHub Desktop.
Save T4cC0re/9f6350717051ac122c5a2e3e0ec7a37a to your computer and use it in GitHub Desktop.
Lock screen after suspend with i3lock and systemd
# /etc/systemd/system/wakelock.service
[Unit]
Description=Lock the screen before suspend
Before=systemd-suspend.service
[Service]
User=t4cc0re
Type=forking
Environment=DISPLAY=:0
ExecStart=/usr/bin/i3lock -ef --image=/opt/wallpapers/lockscreen.png --color=000000
[Install]
WantedBy=sleep.target
WantedBy=suspend.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment