8

I'm using Ubuntu 18.04 on GNOME. When I try to lock my screen, nothing happens. Going into my Privacy settings won't let me enable the Lock Screen. Is this an issue regarding permissions?

vanadium
  • 88,010
  • 1
    Indicate more precisely what you attempt, and what does not work according to your expectations. How do you try to lock your screen? What exactly occurs when you try to enable "Screen Lock" in the Privacy settings? – vanadium Sep 08 '18 at 13:19
  • I use a key on my Keyboard that, when pressed, locks my computer immediately. However, nothing happens when the key is pressed, thus the screen does not lock.

    When I try to enable "Screen Lock" In Privacy, I am unable to enable/disable any of the options given to me, locking me out.

    – Jaybirdy07 Sep 08 '18 at 17:12
  • You probably have something like "gnome-shell[3181]: Screen lock is locked down, not locking" on journalctl output. – Pablo Bianchi Jun 29 '21 at 21:58

2 Answers2

12

Try the default lock screen (screen lock) key combination on Ubuntu 18.04 and Fedora 28 first:

  • Super+L (that is Windows+L). On terminal try xdg-screensaver lock.

  • If that did not work then check whether the following command returns true:

     gsettings get org.gnome.desktop.lockdown disable-lock-screen 
    
  • If the command above returned true then do the following:

     gsettings set org.gnome.desktop.lockdown disable-lock-screen false 
    

Check whether the lock screen (screen lock) works now.

Had a similar problem and this helped me solve my issue.

Pablo Bianchi
  • 15,657
  • Thank you so much, It helped me. My laptop would stay on all the time. with screen on. I hope this solves idle time as well. how doi check idle time? Like if im away from Laptop for 15 min the screen turns off ? – Anne Webster Jan 23 '19 at 14:01
  • Take a look at the Ubuntu Settings power options. "Blank screen" is what needs to be set. – Brennan Sebastian Aug 13 '19 at 18:24
  • working fantastic on ubuntu 18.04.3. Thank you – sam Aug 25 '19 at 12:09
  • Worked for me, but only after switching from lightdm to gdm3, see https://askubuntu.com/a/158487/848796 – xystum Apr 03 '20 at 07:30
2

Here's one thing you can try.

  1. First of all, make sure gnome-screensaver is installed

    sudo apt install gnome-screensaver
    
  2. Try to issue lock command in the terminal:

    gnome-screensaver-command -l
    

    then see if there's any text output in the terminal, such as "Screensaver is not running!"

    If it's the case, run the daemon:

    gnome-screensaver &
    

    then retry the previous lock command. Let's hope it will work now.

Lilly-R B
  • 368
  • Hi, I am having the same issue in 20.04. When I do gnome-screensaver-command -l, it doesn't do anything but if I then run gnome-screensaver & I get Gtk-Message: 09:16:12.329: Failed to load module "appmenu-gtk-module" Gtk-Message: 09:16:12.330: Failed to load module "appmenu-gtk-module" Gtk-Message: 09:16:12.331: Failed to load module "appmenu-gtk-module". Now for next few tries screen is locked after suspend, but goes back to its original not-locked-after-suspend self. Any tips? – nkhl Nov 15 '20 at 03:50