17

I tried the shortcut Super + L nothing happens.

In the settings, have set lockdown timer for 1 min, nothings happens after that.

In the right corner menu after clicking lock item, it is showing black screen and logging me out.

gsettings get org.gnome.desktop.lockdown disable-lock-screen

shows false.

PRATAP
  • 22,460

5 Answers5

27

I was having EXACTLY the same problem. It turns out I have several display managers installed, and I was using lightdm instead of gdm3.

You can confirm you are using lightdm if this command works:

$ dm-tool lock

(But even if that doesn't work you may be using another display manager.)

I got the screen blanking to work properly by configuring gdm3.

Open a terminal and issue this command:

$ sudo dpkg-reconfigure gdm3

Select gdm3 in the list on the terminal, then reboot your system.

  • I'd like to credit Zoyolin for the suggestion to use more precise keywords, which led me to this Reddit discussion https://www.reddit.com/r/gnome/comments/c41biz/lock_screen_doesnt_work/ – Tommy Trussell May 21 '20 at 21:15
  • This worked for me too... but as a further question: does this mean that gdm3 is going to be more taxing on the system? – Jason Mehmel Sep 27 '20 at 03:10
  • I am not concerned about it being taxing; if the chosen display manager does not work correctly with a basic feature I think I would be concerned there might be other incompatibilities I had not found yet. I believe I have multiple display managers only because I tried different desktops, and another desktop surely works more correctly with lightdm. I don't know whether lightdm actually IS "lighter" or less taxing than gdm. – Tommy Trussell Sep 28 '20 at 03:21
  • 1
    if dm-tool lock is working for you, I would just go ahead and update the keyboard shortcut to just that. Settings > Keyboard > Application Shortcuts – lasec0203 Oct 01 '20 at 18:41
  • lxlock failed me running LXDE on top of Ubuntu MATE 20.04, dm-tool lock works. Thanks! – xebeche Oct 13 '20 at 16:49
  • gdm3 is not compatible with nvidia – Melchia Oct 14 '20 at 16:33
  • @Melchia I don't currently have any nvidia hardware running. Do you have a suggestion to improve my answer? – Tommy Trussell Oct 16 '20 at 17:01
  • Well both lighdm and gdm3 still don't work properly when using an nvidia laptop and multiple monitors. – Melchia Oct 16 '20 at 17:36
  • Luckily(?) my brother just mailed me a GeForce GT 710 card for my desktop. I just put it in this desktop running Ubuntu 18.04 and gdm3 3.28.3-0ubuntu18.04.4, and it worked fine using the default Nouveau drivers, and I also tried the recommended NVIDIA Server Driver metapackage from nvidia-driver-450-server. Works fine with two monitors, and it might even work with all three ports active. What problems should I be looking for? – Tommy Trussell Oct 16 '20 at 21:40
  • @Melchia maybe link to a bug report or another AskUbuntu topic that describes your issue so folks finding this might have a place to look. – Tommy Trussell Oct 16 '20 at 21:44
  • I'm using Nvidia RTX 2070 and gdm3. Seems to be working fine since changing from lightdm – forgetso Mar 02 '21 at 20:26
  • thank you, now super + L works and also closing the lid locks my laptop – NewestUser Apr 28 '21 at 21:08
  • I recently upgraded Ubuntu Studio 18.04 to 20.04 and I must say so far it seems to have been a mistake. I had this problem too and tried to follow the steps in this response - dm-tool lock worked, but the gdm3 config didn't work at all. The solution for me was: in settings manager/keyboard, I added a shortcut for dm-tool lock to be associated with SUPER-L. – Ron Kalian Jun 18 '21 at 07:51
  • This answer works. I suspect this issue exists due to an oversight of the ubuntu 18.04 -> 20.04 upgrade process. Ubuntu should have accounted for this during the upgrade. End users should not need to dig deep like this to troubleshoot the upgrade if ubuntu ever intends to go attract a non-technical audience. – Gary Nov 04 '21 at 16:27
2

I have the same gsettings get org.gnome.desktop.lockdown disable-lock-screen config and Super+L works

Could you check Settings > Keyboard Shortcuts > search(Super+L), this one should be assigned to lock the screen.

The lock is a feature of gnome-session. In your research maybe swap "ubuntu" for "gnome" or "gnome3.36.2" with a bit of luck you have the same as me ;)

Zanna
  • 70,465
Zoyolin
  • 61
  • 2
    Thank you for the suggested keywords -- the keyboard shortcuts part didn't help me, but searching for gnome-session did! I hope one of us helps solve the original question. – Tommy Trussell May 21 '20 at 21:16
1

I couldn't even get to "Settings" on my Ubuntu 20.04 box, probably because I've been updating the same hardware since 12.04.

First I had to run:

sudo apt-get install --reinstall gnome-control-center

... to get "Settings" back. Then I typed:

gnome-control-center

... to pull settings up.

While I had Settings up I right-clicked "Add to Favorites" on the toolbar to keep the Settings icon on my desktop.

After that I went to Settings > Privacy > Screen Lock to get at all of the settings.

Earl Ruby
  • 735
0

Problem solved for me by going to

Settings > Screensaver > Lock Screen

and then deactivating Lock Screen.

Now everything works fine for me.

0

Not the OP's case, but if your gsettings get org.gnome.desktop.lockdown disable-lock-screen shows true then you can change it with:

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

I don't know what set that to false on my system, it was a fresh Ubuntu 23.10 install with GDB display manager.