Ubuntu – Lock Screen not working. 14.04

14.04gnome-screensaverlock-screen

I recently upgraded to 14.04 and since then my lock screen is not working.I read online that gnome-screensaver is not supported in Trusty and it was suggested that I install xscreensaver instead. The latter worked fine for only a few days. Moreover even when I log out, I'm not prompted for a password while logging back in.
I read a bit more and found that in Trusty Unity has its own lock screen. So instead of the old lightdm/gnome-screensaver we can use Unity. I found this and tried to check if enabling the lightdm lock screen helped in any way. As it turns out I don't have the Lockscreen option as mentioned in the link.
What could be a possible way to solve the issue?

Best Answer

Try these:

sudo apt-get remove gnome-screensaver
sudo apt-get install xscreensaver xscreensaver-gl-extra xscreensaver-data-extra

Then search for "Screensaver" in the menu and tweak its settings to your needs.

To add Xscreensaver to startup, open Startup Applications and add "xscreensaver -nosplash".

To get CTRL + ALT + L to lock the screen and start the screensaver, go to System Settings > Keyboard and on the "Shortcuts" tab, under "System", change the "Lock screen" keyboard shortcut from CTRL + ALT + L to something else, then under "Custom Shortcuts", click the "+" button to add a new custom shortcut, under "Name" enter "Xscreensaver" and under "Command" enter "/usr/bin/xscreensaver-command -lock", then click "Apply".

And finally, click next to the newly created shortcut and press CTRL + ALT + L to assign it to it (or use any other keyboard shortcut you want, but make sure it's not already assign to something else). Alternatively, you can run the following command instead of assigning a new keyboard shortcut for the old screensaver:

sudo ln -s /usr/bin/xscreensaver-command /usr/bin/gnome-screensaver-command

To revert the changes (go back to the black GNOME Screensaver screen), use the commands below:

sudo apt-get remove xscreensaver xscreensaver-gl-extra xscreensaver-data-extra
sudo rm /usr/bin/gnome-screensaver-command
sudo apt-get install gnome-screensaver

If you've used the alternative method to assign CTRL + ALT + L to Xscreensaver lock screen, open System Settings > Keyboard again, remove the custom Xscreensaver command and assign CTRL + ALT + L back to "Lock screen" (under "System").