Last active
March 24, 2023 13:46
-
-
Save ryukinix/bd0c1ddcbbafdb4149ae70e41b7c822b to your computer and use it in GitHub Desktop.
How lock your system before suspend with openrc init via elogind using slock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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
Thak you very much, that is what I was looking for.