3

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.

Braiam
  • 67,791
  • 32
  • 179
  • 269
Aren Cambre
  • 211
  • 2
  • 9

1 Answers1

3

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.

jan-glx
  • 113
  • 4
steeldriver
  • 136,215
  • 21
  • 243
  • 336
  • Try enabling all of the options outlined at Ubuntu 12.10 http://askubuntu.com/questions/216783/ubuntu-12-10-turn-screen-off-when-inactive-for-never-still-turns-off and advise if that solved the problem. – K7AAY Nov 01 '13 at 00:16
  • All I get with that first command are a bunch of messages like this: (process:10673): dconf-CRITICAL : unable to create directory '/home/[account name]/.cache/dconf': Permission denied. dconf will not work properly.** Yes, I did use sudo. @kiloseven: That only works for the currently-logged in user. I am not logged in when having this problem. – Aren Cambre Nov 01 '13 at 14:15
  • You need to temporarily allow read-write-execute permission to $HOME/.config/dconf. Then set it back when you're done. I still got the msssage "No protocol specified", but running "sbus-launch ... list" again showed that it worked. – Lawrence I. Siden Nov 15 '13 at 17:34
  • I am facing the same issue as mentioned in the question. When i tried gsettings command, I got error message "(process:4554): dconf-CRITICAL **: unable to create directory '/root/.cache/dconf': Permission denied. dconf will not work properly. No such key 'sleep-display-ac'" then I changed permissions by "chmod 777 $HOME/.config/dconf". Now after that when I "ls -l $HOME/.config/dconf" Still the permissions are "-rw-r--r--" How to solve this issue? – debonair Jan 14 '14 at 18:05
  • @lsiden Could you tell me how did it work in your case? – debonair Jan 14 '14 at 18:05
  • This is not an answer I am just unable to comment yet. @debonair and @ArenCambre: add -H such as in: sudo -u lightdm -H dbus-launch --exit-with-session gsettings list-recursively org.gnome.settings-daemon.plugins.power However, for me it does not show any field sleep-display-battery anyway. => Question still unsolved, but I cannot vote yet either.... – jan-glx Jan 15 '14 at 17:17
  • @debonair, sorry, but I can't remember doing anything else besides what I commented on. Hope you've gotten it to work by now. It was pretty annoying. – Lawrence I. Siden Jan 18 '14 at 09:39
  • sleep-display-ac and sleep-display-battery are not available in Ubuntu 13.04 anymore. It seems screen timeout is now controlled by org.gnome.desktop.session.idle-delay but it seems Ok so I guess this is a lightdm (or related) bug. – jjchico Feb 11 '14 at 08:48