Use the same locker/login box from XFCE in i3 to resume from suspend with password prompt


Hello everyone,

I run Manjaro on XFCE. Now I am trying out i3 and I love it so far. My issue is that resume from suspend in i3 does not prompt a user password.

I know that there are workarounds such as: creating an i3lock.service and also using betterlockscreen.

I also know that you can run i3 along with XFCE, which would solve the problem as I would be greeted
with an XFCE dialogue box to enter the password when resuming from suspend.
However, I would like to keep each environment separately.

Ideally, is there a way in i3 to use the XFCE login box? I am not talking about the login box when
you reboot the computer, or the login box when you logout from a session. I mean the login box that greet you upon resume from suspend/hibernate.

Within the i3 config, there is this line:

exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork

I think we need to change the i3lock in this line. I tried using lightdm and lightlocker without any success.

Is this possible in i3? Please let me know your thoughts and thank you !

I believe XFCE uses xfce4-screensaver.

Edit: Sorry, think it's actually xflock4.

I replace i3lock with xflock4, still no results. After closing the lid, laptop goes to sleep/suspend mode. Upon opening up the lid, it goes straight to the desktop without any authentications.

exec --no-startup-id xss-lock --transfer-sleep-lock -- xflock4 --nofork

Well first off, try using xflock4 in the terminal first to see if that command even works. If not, then it's not the correct command.


xflock4 is the reference Bash script which is used to lock an Xfce session.
It tries to lock the screen with either xfce4-screensaver (also part of xfce4-goodies), xscreensaver, gnome-screensaver, slock or xlockmore. It consecutively looks for the corresponding binary or exits with return code 1 if it fails to find any of these.

When using xflock4, the screen goes black and then I have the ability to enter my password to unlock. I think it is the correct command. I just do not know where in the i3 config to make this change.

You can just disable your i3lock and create your own service that uses xflock4 instead.

You can try to write your service based around this:

Forum kindly sponsored by