How do I disable the screen saver in 12.04 system wide?

I have a similar problem as this post: How do I turn off the screen saver using the command line?

However, these new commands (and likewise if I set the options from the GUI) only seem to work if I am actually normally logged in to X.

I am using an XBMC-only desktop session, and when I type this command:

gsettings get org.gnome.desktop.screensaver idle-activation-enabled

I get "true" (which explains why it keeps going blank after 10 mins), but when I type this command:

gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

I get the following:

** (process:4909): WARNING **: Command line 'dbus-launch --autolaunch=b3ac84dfb4159464a026d84900000006 --binary-syntax --close-stderr' exited with non-zero exit status 1: Autolaunch error: X11 initialization failed.\n

Is there any way of altering this setting system wide?


The fix:

sessionfile=`find "${HOME}/.dbus/session-bus/" -type f`
export `grep "DBUS_SESSION_BUS_ADDRESS" "${sessionfile}" | sed '/^#/d'`

Now, try running your command again.

gsettings set org.gnome.desktop.screensaver idle-activation-enabled false

Stack Overflow is awesome.
:)


This seems to have been solved in an update some time ago. It works now at least.

I also figured out that if there are any problems with server-wide screensaver settings, it's probably related to the power saving features.

Which can be turned off with for examlpe

xset -dpms