Ubuntu – How to configure xscreensaver to use the GNOME lockscreen on Ubuntu 14.04


I'd like xscreensaver to lock my session using the standard GNOME lockscreen, instead of using the horrible 1990's xscreensaver lockscreen prompt (sorry guys but it needs a facelift). I know this is possible because I have this configuration working on a different machine, but I don't believe anything special was performed to make it happen.

I have Ubuntu 14.04 64bit installed on my laptop, and have removed gnome-screensaver using "sudo apt-get remove gnome-screensaver". I've added an entry to the startup applications to run "xscreensaver -no-splash". If I wait 5 minutes, the screensaver starts up as expected, however when I move the mouse I find it returns me to an unlocked session. In case you're wondering, yes I'm waiting until after short timeout where it would otherwise allow me to wake up the session without needing to type your password.

I've tried playing around with various configurations under System Settings / Brightness & Lock. The options I've tried setting are ensuring that "Lock" is enabled, and setting "lock screen after" to 5 minutes. However this seems to have no effect. I was actually wondering if this was due to the removal of gnome-screensaver.

I've tried following the steps under the apps man page, however it requests me to modify /usr/share/applications/gnome-screensaver-preferences.desktop which doesn't exist (I believe because gnome-screensaver-preferences is no longer shipped with gnome-screensaver, and is uninstalled in any case).

I then found a slightly different version of the man page here:

Under the GNOME heading it asks you to modify the same file as before, that also doesn't exist.

I'm at a bit of a loss really. I would have thought that if xscreensaver was configured to not lock the screen, but have Ubuntu configured to lock the screen, then the 2 should work together. So I'm wondering if they're conflicting somehow?

Appreciate any and all help.


Best Answer

  • Ok I've resolved this issue now, and am posting the solution for anyone else that wants to do the same as I have.

    1. xscreensaver needs to be launched at startup via "Startup Applications" (hit Super and type "Startup"). Add a new entry to launch the xscreensaver daemon on startup as xscreensaver -no-splash.

    2. You need to bring up the xscreensaver config app. Hit Super and type screensaver. Set the "Blank after x minutes" to your desired amount (e.g. 5 minutes). Remember this value for later. Ensure "Lock screen after" is UNCHECKED.

    3. Finally, go to System Settings / Brightness & Lock. Set "Turn screen off when inactive for x minutes" to the same value as you set xscreensavers "Blank after x minutes" setting (e.g. 5 minutes). Then still under Brightness & Lock, set "Lock screen after:" to "Screen turns off".

    And you're done! If your system is idle for the set amount of time, the screensaver will kick in, and in the background your session will also lock. When you wake your system, you will find it locked and asking for your password. No ugly 90's login prompts... awesome. The one caveat is that your screensaver will apparently not kick in if your session is already at a login prompt, the screen will simply turn off.