Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
is the link you provided in anyways related to the question???? – Ashu May 11 '12 at 15:47
Yes it is. You'll notice, if you read the question and its related answer, that the chap was dealing with the same problem as the OP, and that he also found the solution. I tested it out myself and it works. I didn't want to take credit for sigo's handiwork, ergo the link. Why do you ask? – SirCharlo May 11 '12 at 15:54
That did something, but now i get WARNING **: Could not connect: Connection refused. I read something about that being caused by the terminal not being connected to the x session...any idea how I control that? – Yngvefaen May 11 '12 at 19:15
I thought maybe this link was related, but couldn't figure out how to fix the problem; – Yngvefaen May 12 '12 at 7:20
Special thanks for pointing out how to connect to DBUS. – mikezter Nov 3 '13 at 21:22
up vote 1 down vote accepted

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.