I found this answer, but that's about Gnome. I couldn't find an answer about Xfce on Super User.
3 Answers
On my laptop (Arch linux + xfce4) two combinations work
$ xfce4-screensaver-command --lock
and the one mentioned by @Harm
$ xflock4
You can set a keyboard shortcut for locking the screen by going to menu
Applications -> Settings -> Keyboard
Then open tab Application Shortcuts and click on + Add, enter any of the commands mentioned above and click OK (you will be asked to assign a keyboard shortcut to it).
p.s. Note that xflock4 is usually available in keyboard shortcuts under Ctrl-Alt-L, so before adding new commands check that neither xflock4 nor xfce4-screensaver-command is already present in the list of commands.
- 278
I found this on ArchWiki. So the canonical way to do this seems to be:
xflock4
This is wrapper (run cat $(which xflock4)) that checks xfconf-query -c xfce4-session -p /general/LockCommand for the configured lock command and tries to run that. It also includes fallbacks to other access locking utilities.
- 202
- 1
- 2
- 8
This seemed to work for me:
gsettings set apps.light-locker late-locking false
gsettings set apps.light-locker lock-after-screensaver 0
gsettings set apps.light-locker lock-on-suspend true
The simple way I found that was to enter in a terminal:
dconf watch /
Then make the changes in the GUI like all the tutorials tell you, and keep watch on that terminal.
The output from the terminal is:
/apps/light-locker/late-locking
false
...which translates into the gsettings command I listed above. FYI value out of unit32 0 means just input 0 for the final value, which is the second line with lock-after-screensaver 0. The unit32 datatype isn't necessary in the command line.
- 215