I am trying to to set a global screensaver and blanking idle timout (with screen locking) that will affect all new user accounts. I noticed that gnome-screensaver in 12.04 when configured by a user, writes some data to a blob in ~/.dconf, but I have no idea how to set it globally. I also know that the global timeout is 10 minutes with blanking, but have no idea where this is set system wide. I find the whole dconf transition a bit difficult.

If it is not possible to configure gnome-screensaver this way, I would be quite interested in a solution with xscreensaver/xlock.

The purpose of this is to set a blank screen with automatic locking. Both because of resource usage and security.

Forgot to mention that this is a default Ubuntu 12.04 desktop install with Unity and LightDM. I will however install gnome-shell and gnome-session-fallback to let people choose. It would be nice if a solution works across different sessions.


Which dconf keys are used

To know which keys are changed in dconf, you can use dconf watch / while changing settings. In this case, you'll see something like :



  uint32 1800

Then, you put these keys in a file in /etc/dconf.

Create and activate /etc/dconf

If this directory does not exists, you have to create it and activate its use with these commands :

mkdir -p /etc/dconf/profile /etc/dconf/db/local.d
cat <<EOF >/etc/dconf/profile/user

cf: https://live.gnome.org/dconf/SystemAdministrators

Put your global settings

Use a file in /etc/dconf/db/local.d named, for example, screensaver-delay:



Apply it running the command: dconf update. It will (re)generate the file /etc/dconf/db/local which will be used if keys do not conflict with user defined values.

Force global values

If you want to force these global values over user selected values, you can do it by using a file in /etc/dconf/db/local.d/locks named, for example, screensaver-delay:

# Force screensaver delay
  • 1
    The line with cat <EOF should be cat <<EOF (bash "here-documents"). – Victor Feb 28 '14 at 16:10

xscreensaver option (tested on Xubuntu 12.04): Edit /etc/X11/app-defaults/XScreenSaver (as root) to set lock to True and lockTimeout to whatever time you want. This will change the default for all users, but the users can still change it using the normal preference mechanism.

  • This solution is still valid for Xubuntu 18.04 – Anon Nov 10 '18 at 8:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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