Ubuntu – How to let screen time out on sign in screen


I have Ubuntu 13.10 set up on an older PC. If I am logged in as a user, then the screen timeout and power saving mode works as expected. However, if nobody is logged in, the screen never times out, and the monitor stays on all the time with the login screen.

How can I adjust Ubuntu 13.10 so that the login screen also times out after a minute or so? I don't want the monitor's power saving mode to be disabled just because nobody is currently logged in.

Best Answer

The default lightdm display manager runs the login screen under its own system account, so I believe you will need to change the power settings daemon's settings for that account.

Since the lightdm account is not a login account, you can't do that directly (as far as I know), however you can run configuration commands using either the dconf or gsettings utilities by using sudo su. For example, to see what the current power settings are for the login process

$ sudo -H -u lightdm dbus-launch --exit-with-session gsettings list-recursively org.gnome.settings-daemon.plugins.power
No protocol specified
No protocol specified
org.gnome.settings-daemon.plugins.power active true
org.gnome.settings-daemon.plugins.power button-hibernate 'hibernate'
org.gnome.settings-daemon.plugins.power button-power 'interactive'
org.gnome.settings-daemon.plugins.power button-sleep 'suspend'
org.gnome.settings-daemon.plugins.power button-suspend 'suspend'
org.gnome.settings-daemon.plugins.power critical-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power idle-brightness 30
org.gnome.settings-daemon.plugins.power idle-dim-ac false
org.gnome.settings-daemon.plugins.power idle-dim-battery true
org.gnome.settings-daemon.plugins.power idle-dim-time 30
org.gnome.settings-daemon.plugins.power lid-close-ac-action 'suspend'
org.gnome.settings-daemon.plugins.power lid-close-battery-action 'suspend'
org.gnome.settings-daemon.plugins.power notify-perhaps-recall true
org.gnome.settings-daemon.plugins.power percentage-action 2
org.gnome.settings-daemon.plugins.power percentage-critical 3
org.gnome.settings-daemon.plugins.power percentage-low 10
org.gnome.settings-daemon.plugins.power priority 1
org.gnome.settings-daemon.plugins.power sleep-display-ac 600
org.gnome.settings-daemon.plugins.power sleep-display-battery 600
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'suspend'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'
org.gnome.settings-daemon.plugins.power time-action 120
org.gnome.settings-daemon.plugins.power time-critical 300
org.gnome.settings-daemon.plugins.power time-low 1200
org.gnome.settings-daemon.plugins.power use-time-for-policy true

You can compare these against your user account's settings by running the same command as a normal user, without the sudo dbus-launch... part i.e.

$ gsettings list-recursively org.gnome.settings-daemon.plugins.power

It should be possible to set the behaviour as well using gsettings or dconf, for example to set the login screen to sleep after 120 seconds (2 minutes) of inactivity when on battery power

$ sudo -H -u lightdm dbus-launch --exit-with-session gsettings set org.gnome.settings-daemon.plugins.power sleep-display-battery 120

There is an equivalent setting sleep-display-ac for the sleep time when on AC power.