0

I'm looking for a way to disable screen dimming and desktop locking timeout from a bash script on Ubuntu 13.10. The script should be run when user logs in (configured in Startup Applications window) or as a service before lightdm (from init.d).

I have found this answer and tried the command:

gconftool-2 -s /apps/gnome-screensaver/idle_activation_enabled --type bool false

It has actually changed that setting (I've checked with gconftool-2 -g and gconf-editor), but it doesn't seem to work like expected. Settings window still states that screen will turn off, and in fact, after 5 minutes screen turns off and I'm prompted to enter my password when I wake it up.

I've also tried looking around in gconf-editor, but I haven't found any settings that looked relevant.

So, how can I disable desktop locking and screen off timeout from a script?

gronostaj
  • 720

2 Answers2

1

Partial answer (I didn't try to change configuration)

I think that new Ubuntu(s) use dconf and not gconf --- try to look for parameters in dconf-editor (settable via command line with the confusing-named gsettings).

I think that the relevant schemas are around org.gnome.desktop.screensaver, at least for gnome. I do not have Unity installed so I think you need to research a bit around to adapt...

Rmano
  • 31,947
  • 1
    You were right, org.gnome.desktop.screensaver.idle-activation-enabled and org.gnome.desktop.screensaver.lock-enabled were the settings I was looking for. – gronostaj Nov 18 '13 at 22:04
1

Here's the solution I've confirmed to work based on @Rmano's answer:

dconf write /org/gnome/desktop/screensaver/idle-activation-enabled false
dconf write /org/gnome/desktop/screensaver/lock-enabled false

After executing any of those you should see settings changing immediately in dconf-editor, Settings center will reflect changes too. Finally, settings will be immediately applied, so you can wait given period of time and see that the screen saver won't turn on.

gronostaj
  • 720