

Give it a shot, tweak as you need to and in the end, it’s all about what you want and how you wan to do it. In the Plugged in section, select Suspend, and then click Close. Go to Applications Settings Power Manager menu. In my case, once I close the lid, the lappy hibers and when I open it - I am prompted for a password. We apply that to the situation of closing the laptop lid, the system goes to sleep and the screen is locked by XScreenSaver, in XFCE.

I have a feeling that that line is just left over and I never removed it so it may not be needed. The second line I have in the i3 config simply sets the auto-lock color to a black screen.
#Xscreensaver suspend lock password
The password via xscreensaver, you have 30 seconds before it goes back to the screensaver.Īnd lastly, I don’t want xscreensaver to display the splash screen (because it will give someone the ability to change the screensaver settings at that point). The lock timeout is set to 0 (that means it requires a password once the screensaver kicks in. So basically, the screensaver kicks in in 15 mins. xscreensaver file, I have these set for my default timings: You will also want to set the time outs too. For example, you may only want one screen saver opposed to the default of random. You will need to run xscreensaver to set the parms you want. I installed xsceensaver also since I actually want a screen saver to kick in.Įxec -no-startup-id xscreensaver -no-splash &Įxec -no-startup-id xautolock -time 30 -locker “i3lock -c 000000” If it is still suspending, have you rebooted or restarted logind after making those changes to nf? You can't just edit the file and have the changes implemented right away, as the configuration is parsed and the settign implemented on the service start.What I’m about to show you works for me quite well (YMMV - and in the end, may not be what you are looking for).
#Xscreensaver suspend lock install
To see what kinds of things trigger a udev event, you can use udevadm monitor or if you install acpid, there is the acpi_listen option.Įdit2: BTW, what is it you mean by not working? Does it still suspend on lid close, or is your xscreensaver not started? You need to be more explicit there. It can allow for one central script (or collection of scripts) to handle all the different events that udev sends. But it is a much easier method of setup since it simply relies of basic scripting in order to make it work. I followed these instructions on the wiki and created the following rvice. I would recommend using acpid, as it is much more flexible in what it can allow you to do.Įdit: acpid is not necessarily more flexible than a udev rule, as it relies on the udev events. Ive tried to make my XScreenSaver lock when suspending but it seems not to work at all. The lid switch sends an event to udev, so you have the option of having a udev rule that responds to this, or using acpid to start this for you. Therefore, you are going to have to have some other way of triggering actions in response to these events. Using the LockXScreenSaver option in nf locks all X displays. So if it is set to ignore the lid switch, then it obviously isn't going to be entering the suspend.target (or is it the sleep.target, I can't remember). I use suspend2 to suspend to HDD, and I want to lock the screen when suspending.

I would say that you should just have logind ignore the LidSwitch altogether.
