-
Install both
xscreensaverandxsecurelockusing your package manager -
Make sure
xscreensaveris not set to lock the screen or to manage the display. Xfce aleady does all those, so there is no need to enable it again. -
Also make sure that the
xscreensaverdaemon is not autostarted. Not doing this may result in the screen not being locked. -
Set the following environmental variables (in
~/.xprofileor~/.xsession) forxsecurelock:# xsecurelock options export XSECURELOCK_SAVER=saver_xscreensaver export XSECURELOCK_PASSWORD_PROMPT=disco XSECURELOCK_FONT='Noto Serif CJK JP' export XSECURELOCK_SHOW_DATETIME=1 export XSECURELOCK_SINGLE_AUTH_WINDOW=1 export XSECURELOCK_AUTH_TIMEOUT=30You can find more options here.
-
Finally, we need to tell xfce to use
xsecurelock. Do that with this command:
xfconf-query --channel xfce4-session --property /general/LockCommand --set "xsecurelock"
Restart the current session or reboot. Profit!
How can I setup auto locking ? This working for me :