21

On Ubuntu 11.10, when on battery, the screen dims after 10 seconds of inactivity. This is annoying because it is too short. Is there anyway to increase this timeout?

I know I can disable it, but that is not what I want.

fossfreedom
  • 174,664
amfcosta
  • 769

4 Answers4

17

This command should set the time to 60 seconds:

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

In earlier Ubuntu versions, this setting can be found with the gconf-editor under gnome-power-manager. See also this thread.

lumbric
  • 4,139
  • 4
    I'm absolutely comfortable using the terminal (and this worked great for me by the way), but I sure do wish Ubuntu 11.10 let me change these kind of things through the "System Settings" GUI... – blong Feb 17 '12 at 00:01
  • There's no reason this shouldn't be configurable through the GUI settings. – apdnu Jul 23 '12 at 16:16
  • 1
    gconf-editor does not exist in newer Ubuntus any more. Use dconf-editor instead. – Karl Frisk Nov 22 '12 at 14:51
  • 4
    This answer no longer works as of Ubuntu 14.04. It reports "No such key 'idle-dim-time'". Some of us would like to be able to do this from a script (e.g. as a wrapper for something that's going to play video to the screen), so the GUI is not usable. See my answer below. – BobDoolittle Sep 16 '14 at 18:24
  • This is no longer actual, newest ubuntu doesn't have this key. See BobDoolittle's answer – Handsome Jack May 16 '22 at 18:25
  • Key doesn't exist in Ubuntu 24.04. – Daniel C Oct 09 '24 at 14:10
13

The answer marked above from 'lumbric' no longer works for Ubuntu 14.04.

If you need to do this from a command (e.g. for a script wrapping something that plays video), you now need to run:

gsettings set org.gnome.desktop.session idle-delay <seconds>

also useful in such a case might be disabling the screen lock:

gsettings set org.gnome.desktop.screensaver lock-enabled false

BobDoolittle
  • 1,169
  • 1
    Thanks, also `gsettings set org.gnome.desktop.screensaver lock-delay " – Bohr Jun 28 '15 at 11:35
  • @Bohr: useful. But if I were writing a wrapper around something that played video, I might not know how long it is. So I'd probably disable it first, and declare a "trap 0" function that re-enabled it on exit, using 'gsettings set org.gnome.desktop.screensaver lock-enabled true'. That way it would disable the screen lock exactly as long as I need it to be. Of course that's vulnerable to signals that can't be handled, like SIGKILL but that's unlikely in practice. – BobDoolittle Jun 09 '16 at 22:32
  • 1
    Works like a charm in 22.04! This should be accepted anwesr nowadays – Handsome Jack May 16 '22 at 18:28
  • 1
    This doesn't work for me. idle-delay is currently set to 300 seconds, while the screen dims after 30 already. I'm guessing idle-delay is the time before the screensaver is activated? Not the time until screen brightness is reduced? – Kees-Jan Oct 26 '22 at 10:51
  • 1
    agreed it's the current (2023) right answer for 22.04 (and probably most of recent versions) – Florent Destremau Apr 12 '23 at 08:41
  • @Kees-Jan You're correct. The idle-delay key is the amount of time before screen goes blank (and locks the screen too, if lock-enabled is on). In Ubuntu 24.04 this has the side effect of increasing the dim timeout because it appears the screen dims when it reaches half the idle-delay; for example, if idle-delay is 1800 the screen dims at 900 at least that's what is seemed when I played around with the key. – Daniel C Oct 09 '24 at 14:10
1

In 12.04, the setting using GUI now exists via System SettingsBrightness and Lock.

Peachy
  • 7,245
  • 10
  • 40
  • 47
  • 6
    I'm using 12.04, all updates installed, and there's no setting to set the screen dim timeout in "Brightness and lock". The only "timeout" option on the "Brightness and lock" settings menu is to turn the screen off, which is not the same thing as dimming its brightness. – amfcosta Sep 13 '12 at 13:38
0

This works in ubuntu 24.04:

gsettings set org.gnome.settings-daemon.plugins.power idle-brightness 100

Apparently there is no way to disable this 30 second idle timer, so we simply configure the reduced brightness to the same value as it was before, by using the above command.

Setting only the idle-dim to false doesn't fix it, as the screen still dims after 30 seconds. I think this is the one exposed in UI controls. It can be verified in terminal using the following get command:

gsettings get org.gnome.settings-daemon.plugins.power idle-dim

I am not sure where the 30 seconds timer is coming from, but setting idle-brightness to 100 fixes it for now, and we can all get back to work.

  • 1
    I suspect the dim time is hardcoded. From observation is appears to take about half the time of whatever is in Screen Blank in GNOME Settings -> Power (called idle-delay via gsettings). In your case, if dim switches on after 30 sec then maybe you're idle-delay is set to 1 min. Increase it to, for example, 2 min and dim will kick in at approx. 1 min mark. (My idle-delay is 30 min, dim kicks in at ~15 min.) – Daniel C Oct 09 '24 at 14:23
  • My "screen blank" is set to "never", so maybe it took the first available valid option in the drop down and took 50% of it like you said :-) – Mani Jagadeesan Oct 09 '24 at 14:31