Skip to content

Instantly share code, notes, and snippets.

@ryukinix ryukinix/lock.sh
Last active Feb 16, 2019

Embed
What would you like to do?
How lock your system before suspend with openrc init via elogind using slock
#!/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
You can’t perform that action at this time.