4

is it possible to set different blank screen timeouts in Ubuntu 18.04 with Gnome when on battery or ac? The power settings menu provides only one field which is applied always, no matter of the current mode.

This question was already asked for the Unity desktop a while ago (How can I set a different screen timeout time when on battery than if I am plugged in?) and they did not find a solution but I had the hope that that might have changed with Gnome now.

  • You mean when connected to AC power = x secs. And when running on battery = y secs. Like this? – PRATAP Sep 14 '18 at 09:13

2 Answers2

4

Install "dconf Editor" tool.
search with the keyword "sleep".
go to the filed "sleep-inactive-ac-timeout"
Give your preferred amount of time in seconds.
go to the filed "sleep-Inctive-ac-type" and choose the preferred value. (i have set it to blank)
same thing do it for "battery mode" also.

enter image description here

enter image description here

enter image description here

enter image description here

PRATAP
  • 22,460
  • 1
    Perfect, thanks a lot! That was exactly what I was looking for. – InvisibleShadowGhost Sep 14 '18 at 10:17
  • Please note that when those values are custom set, system settings=>power=>blank screen is ignored. – PRATAP Sep 14 '18 at 10:30
  • Note that this effectively disables suspending the machine when idle. These settings are also accessible right from the Power settings panel by clicking on "Automatic suspend". This is not an ideal solution, as we need separate timers for screen blank vs suspend. – hackel Jun 11 '19 at 22:14
  • 2
    These settings have nothing to do with blank screen timeouts. These set when to put the computer into sleep. – bviktor Jul 25 '19 at 16:02
  • The single drop down is actually setting this for you already based on your current context. If you have the device on AC when you set the drop down, it sets the dconf setting for ac-timeout. If you set the drop down when on battery, it sets the dconf setting for battery-timeout. Terrible UI design that doesn't make this obvious, but you can confirm this in the Dconf Editor. – mtalexan Mar 04 '21 at 17:34
  • 1
    This does not answer the question because it does not change the screen blank setting (as noted by @bviktor). This changes the "automatic suspend" option that is already accessible from within the settings app with separate ac and battery settings. So these are the wrong settings, and you don't even need dconf editor to modify these settings. – Drew Nutter Jul 10 '21 at 18:19
1

No it's not possible. As of version 3.38, GNOME does not have different settings for this on ac/dc.

  • The blank screen setting is /org/gnome/desktop/session/idle-delay
  • The lock setting is /org/gnome/desktop/screensaver/lock-delay

Both are configurable via gui in gnome-settings.

Btw: as noted in the comments the accepted answer configures when the computer goes to sleep. That can be configured differently on ac/dc.

bernstein
  • 121
  • I do not understand why Gnome developers thought it was a good idea. Windows supports setting different values, and even macOS seems to support it as well. I think most user would want different automatic screen off time depending on AC/battery. – Damn Vegetables Jan 28 '24 at 04:52