Skip to content

Instantly share code, notes, and snippets.

@ryukinix
Created February 13, 2019 11:32
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 ryukinix/bbd4b28f620b5c88fefa2beb57e91ac7 to your computer and use it in GitHub Desktop.
Save ryukinix/bbd4b28f620b5c88fefa2beb57e91ac7 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# /lib/elogind/system-sleep/lock.sh
# Lock before suspend integration with elogind
username=lerax
userhome=/home/$username
export XAUTHORITY="$userhome/.Xauthority"
export DISPLAY=":0.0"
case "${1}" in
pre)
su $username -c "/usr/bin/slock" &
sleep 1s;
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment