GConf Overview

Tip

Readers should first read the GNOME Desktop System Administration Guide's GConf section and the GConf project page before continuing.

Configuration Sources

GConf stores preferences data in a set of configuration sources. The sources used, their properties and the order in which they are used by GConf is defined in the /etc/gconf/2/path path file.

Each configuration source entry has three parts:

Storage Backend Identifier

The only commonly used configuration backend is the XML backend whose identifier is xml.

Configuration Source Flags

A comma separated list of flags which is interperated by the storage backend. The XML backend recognises two flags - readonly and readwrite which determine whether the configuration source is writable.

Storage Location

The location in which the storage backend should store the preferences data. The exact meaning of this storage location depends on the storage backend in use. With the XML backend the location is the path to a filesystem directory.

By default there is a Mandatory Source, a User Source and a Defaults Source. They are:

  • xml:readonly:/etc/gconf/gconf.xml.mandatory

  • xml:readwrite:$(HOME)/.gconf

  • xml:readonly:/etc/gconf/gconf.xml.defaults

The order of the configuration sources is intentional. If a key is set in the Mandatory Source and the Defaults Source, then the value in the Mandatory Source takes precedence. Therefore, by setting a key's value in the Mandatory Source, users will not be able to modify that key.

The default GConf path file also includes a number of other path files if they exist. The /etc/gconf/2/local-defaults.path and /etc/gconf/2/local-mandatory.path allow administrators to define new configuration sources and include them in the set of configuration sources used by GConf. The configuration sources specified in the local-defaults.path file are included before the standard Defaults Source. The sources in the local-mandatory.path file are included after the standard Mandatory Source.

One final item of note is that a source's storage location specifier may also reference the value of environmental variables. For example, the standard User Source is defined as xml:readwrite:$(HOME)/.gconf. Environmental variables may be defined as follows:

$(HOME)

The user's home directory.

$(USER)

The user's username.

$(ENV_name)

Any other environmental variable may be reference by prefixing the environmental variables name with ENV_.