28

I'm running Ubuntu 18.04 on a laptop. When I lock the computer, I want the screen to remain on indefinitely. I do want the computer to lock automatically when it is idle (but still, the screen should remain on).

First I tried in Settings -> Power to set Blank Screen to never, but that did not work. I have tried the suggestions from others who asked the same question here, but they are for different versions of Ubuntu and none of them worked for me.

Does anyone know how to fix this problem in 18.04?

4 Answers 4

26

I was looking for a way around this, and I think I've finally got it!

Gnome Extension

I looked through the bug that was referenced here to find the link to that extension.

2
  • 3
    This works perfectly for me. I find it easier than the other solution, because sometimes if you hold the key too long you will go to the login screen, and you need to log in and lock the screen again. This is much easier, so I accepted it as the answer. Thanks!
    – MTV DNA
    Jul 20, 2018 at 9:21
  • In my machine for some reason this only happened when locking with Super+L - it didn't happen when I locked the screen via the session menu.
    – fquinner
    Sep 10, 2018 at 13:25
25

When you lock your screen manually with Super + L just hold it a bit longer, then the screen will not blank immediately. It blanks after the time interval you set at Settings > Power > Blank Screen.

Edit: I tested it once again (this time it was chaging) and the screen did not blank when I locked my PC this way. It did not blank even after a few hours of idle time. So it probably only blanks when running on battery.

4
  • 2
    long hold Super + L worked on desktop as well.
    – a113nw
    Jan 17, 2019 at 15:27
  • Any idea why this method works? Does holding Super+L longer have the same effect of pressing Super+L followed by another key, such as Enter?
    – jII
    Mar 14, 2020 at 14:47
  • 1
    @4myle: still works in Ubuntu 20, and it's great for monitors that don't resume properly from standby. Jul 16, 2020 at 5:35
  • @jII I'm fairly certain this is only working because it's causing the keystroke to be repeated, which instantly cancels the blanking. You should be able to achieve the same effect by pressing any other key or moving the mouse immediately after locking the screen. If you have screen blanking disabled in the power settings it won't blank again. The answer from James is the actual solution for disabling it.
    – Herohtar
    Nov 13, 2021 at 6:09
3

Check the current setting using:

gsettings get org.gnome.desktop.screensaver idle-activation-enabled

If the result is true turn it off using:

gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

Second option to try is:

gsettings set org.gnome.settings-daemon.plugins.power idle-dim false

Gnome bug

There is a four year old Gnome bug addressing the issue of screen blanking immediately after lock here.

6
  • Thanks for your answer. I tried it, but unfortunately this does not work. Immediately after I lock my pc the screen goes blank.
    – MTV DNA
    May 18, 2018 at 13:45
  • Which desktop are you using in 18.04? Gnome, Unity, etc. May 18, 2018 at 13:48
  • I am using the default desktop (Gnome 3.28.1).
    – MTV DNA
    May 18, 2018 at 14:10
  • I'm using Unity. I'll try to remember to test 18.04 gnome this weekend. May 18, 2018 at 14:12
  • I looked at the bug you posted, but I have nu idea what to do with the patches posted there. Anyways, the solution posted above works for me. Thanks for your help regardless!
    – MTV DNA
    May 23, 2018 at 11:50
0

I have solved this issue by installing lightdm login manager.

The default Ubuntu login screen is called lightdm. Chances are it's already installed in your system, so you can just run sudo dpkg-reconfigure lightdm to re-select it. If it isn't installed, just run sudo apt-get install lightdm and then follow the commands in the wizard. If you want to uninstall the other login screen (really a display manager), write down the other choices that show up when you run the reconfigure command.

For me gdm3 was already installed, so the istallation wizard wanted to confirm which login manager to use by default, where I choose lightdm.

That's all.

1
  • any idea how to do the opposite of what the question asks with lightdm? e.g. when i manually lock the screen I want it to power off immediately and not wait 5 minutes or whatever the idle timeout is. (I have tried a script to switch to the greeter and them use dpms to power off, but it fails in that order and in the reverse order the greeter turns the screen back on!)
    – Michael
    Jul 23 at 18:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.