I am trying to get xfce to lock my screen on suspend, but not on hibernate.
As I am using full disk encryption, I need to enter a password after hibernation to unlock my SSD (and I don't want to enter two passwords), but after suspending, my system currently does not require a password.

The "Lock screen when system is going to sleep" option under security in the xfce power manager only works for both suspending and hibernating, not for just suspending. Is there a way to achieve this?

I am using Manjaro Xfce with LightDm.

1 Answer 1


So, yesterday I accidentally stumbled accross this thread on askubuntu.com, and one of the answer uses dm-tool lock ( after setting XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0) to lock the screen from a script in /lib/systemd/system-sleep/.
After adapting this a bit, I came up with the following script:


if [[ "$1" == "pre" ]]; then
    pkill intel-virtual
    sleep 1
    if [[ "$2" != "hibernate" ]]; then
        XDG_SEAT_PATH="/org/freedesktop/DisplayManager/Seat0" dm-tool lock 
    sleep 1

(Note: pkill intel-virtual; sleep 1 is only necessary due to my specific hardware setup using Nvidia hybrid graphics. Most other people should be able to delete those lines.)

Putting this in an executable script in /lib/systemd/system-sleep/ solves my issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .