Skip to content

Instantly share code, notes, and snippets.

@ArdaXi
Last active December 14, 2015 02:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArdaXi/5013361 to your computer and use it in GitHub Desktop.
Save ArdaXi/5013361 to your computer and use it in GitHub Desktop.
#!/bin/bash
command -v xlock > /dev/null 2>/dev/null || exec notify-send -u critical 'xlock is missing'
exec xlock -mode blank
[Unit]
Description=Lock X session using xlock
After=sleep.target
[Service]
User=%I
Environment=DISPLAY=:0
ExecStart=path/to/lock
[Install]
WantedBy=sleep.target
#!/bin/bash
(sleep 1 && exec sudo systemctl suspend) &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment