98

The maximum lock time in Ubuntu 18.04, when set via GUI, is 15 minutes. This can be set in SettingsPowerPower SavingBlank screen.

I'd like to increase this to 30 minutes for my machine at home. How can I do that?

pomsky
  • 68,507
Daniel
  • 3,980
  • 4
  • 29
  • 36
  • Related, for system admins to override and lock down settings like this: https://help.gnome.org/admin/system-admin-guide/stable/desktop-lockscreen.html.en and https://help.gnome.org/admin/system-admin-guide/stable/dconf-lockdown.html.en. – Gabriel Staples Feb 03 '20 at 07:53
  • 3
    Yeah it's ridiculous that it's 15 mins to never, like, nothing in between is an option. – Sephethus Dec 11 '20 at 02:55
  • 2
    Instead of Settings > Power > ..., got to Settings > Privacy > Screen Lock, as described by Nicolai below. On 20.04 you'll see select boxes for both "Blank Screen Delay" and "Automatic Screen Lock Delay". Although the options are still very limited, this does allow you to set e.g. a 30 minute or 1 hour delay until the screen actually locks. – djvg Sep 06 '21 at 07:07
  • Doesn't seem to work @Nicolai. But thanks anyways! – Harlin May 22 '22 at 19:03

4 Answers4

119

Open Terminal and run:

gsettings set org.gnome.desktop.session idle-delay 1800

to set the "Blank screen" delay to 30 minutes or 1800 seconds (or set any value in seconds). You can use $((30*60)) to use minutes directly.

Note: After making the change, in SettingsPowerPower SavingBlank screen it will show "Never" as there is no entry for 30 minutes.

To lock: The number of seconds after blank screen activation before locking the screen (default: 0)

gsettings set org.gnome.desktop.screensaver lock-delay 0

Needed: Set this to TRUE (default) to lock the screen when the blank screen goes active

gsettings set org.gnome.desktop.screensaver lock-enabled true
Pablo Bianchi
  • 15,657
pomsky
  • 68,507
  • 7
    there must be a way to define those picklist choices such that updated list will appear on UI afterwards – Scott Stensland Jul 16 '18 at 16:22
  • 16
    In Ubuntu 20.04 by specifing a new value in terminal the new 30 minutes option is automatically created for you in UI – David Aug 31 '20 at 13:32
  • 2
    7200 seconds is ideal since at home if I'm away longer than that I'm probably done for the day. – Sephethus Dec 11 '20 at 02:55
  • 1
    to get current idle-delay: gsettings get org.gnome.desktop.session idle-delay – Timo Jun 05 '21 at 15:57
  • You only described about lock screen/dim screen. What about auto-suspend? The UI settings only allows 2 hours until suspend. How can I manually maximize it like you said about lock screen timeout? – Vin Raghav Sep 26 '22 at 05:34
36

The timeout for locking the screen after it goes blank can be achieved via GUI.

When using Ubuntu 18.04 open Settings. There select the Privacy settings tab. Now the Screen Lock option will be visible. When clicked, a modal window with the specific settings will open.

There you can toggle Automatic Screen Lock on/off, set a time for locking the screen or respectively binding it to the screen turning off via Lock screen after blank for, last but not least Show Notifications lets you decide if notifications should be shown on the lock screen.

So the path for the option you want to change is:
Settings → Privacy → Screen Lock → Lock screen after blank for
There you can select 30 minutes as the lock screen time.

screenshot

pomsky
  • 68,507
  • 5
    Hmm... not sure whether it's the same thing. OP is asking for an option to change Blank screen delay, i.e. duration of inactivity that will turn screen off, whereas the settings you have mentioned is for "Lock screen after blank for" which I reckon means after the screen is off, how long the system will wait before locking the screen so that you'll have to provide your password on waking up. – pomsky Jun 25 '18 at 13:05
  • 4
    Well he said maximum lock time, which can be set to more then 15 minutes via GUI. That's all I pointed out, if not for the OP, it might be helpful to somebody. @pomsky – Nicolai Grossherr Jun 25 '18 at 15:23
  • 1
    There is no Privacy tab or choice in my Settings panel in 18.04. – WhereIsTheManual Dec 22 '18 at 01:53
  • @42- It is there for me, so I don't know what to say. Might be called privacy settings or so, I'm not running it in English. Take a look at the documentation. – Nicolai Grossherr Dec 22 '18 at 09:36
  • 3
    This answer is useful but what I was looking for is to immediately lock screen after blank – lock-delay 0 – and keep screen on for 30 minutes, or some other time, before the blank screen – idle-delay 1800; basically @pomsky 's answer. (This allows me to read from the screen during those 30 minutes.) – Daniel Jan 28 '19 at 10:42
  • Everyone has different demands, we offered two options for anyone searching, which is good. @Daniel – Nicolai Grossherr May 13 '19 at 21:45
  • I was wondering why the screen was locked after that 15 minutes screen blanking. The time is too short for my home PC to auto lock after such a short period. But the privacy section explains why. – Markus Zeller Jun 23 '21 at 07:19
  • 1
    On Ubuntu 20.04 you'll see select boxes for both "Blank Screen Delay" and "Automatic Screen Lock Delay". Might be worth updating the image above. – djvg Sep 06 '21 at 07:13
21

There are 2 different settings, one for blank screen and second for locking screen after blank.

1. Set timeout of "Blank Screen"

  • In GUI: SettingsPowerPower SavingBlank screen

  • In Terminal:

      gsettings set org.gnome.desktop.session idle-delay 1800
    

to set the "Blank screen" delay to 30 minutes or 1800 seconds (or set any value in seconds).

Note: After making the change, in Settings GUI editor it will show "Never" as there is no entry for 30 minutes.

2. Set timeout of "Lock screen after blank"

  • In GUI: SettingsPrivacyScreen LockAutomatic Screen Lock Delay

  • In Terminal:

      gsettings set org.gnome.desktop.screensaver lock-delay 600
    

to set the "Lock screen after blank for" delay to 10 minutes or 600 seconds (or set any value in seconds). Set 0 to lock immediately after blank screen.

To sum up

Combining these 2 parameters user is able to achieve for example:

  • Blank screen after 10 minutes but lock after another 10 minutes (20 minutes overall to lock).
  • Blank screen after 5 minutes and lock immediately.
  • Blank screen after 30 minutes and lock after another 1 hour
  • Any other combination depending on user's need.
John Mee
  • 953
  • 1
  • 8
  • 18
2

To set Blank Screen as "never" on Ubuntu 20.04, you should use:

gsettings set org.gnome.desktop.session idle-delay 0