Each preference in the GConf repository is expressed as a key-value pair. A GConf preference key is an element in the repository that corresponds to an application preference. For example, the /apps/gnome-session/options/show_splash_screen preference key corresponds to the Show splash screen on login option in the Sessions preference tool. The GNOME Desktop user interface does not contain all of the preference keys in the GConf repository. For example, the Panel preference tool does not contain an option that corresponds to the /apps/panel/global/tooltips_enabled key.
The repository is structured like a simple hierarchical file system. The repository contains the following:
Preference keys typically have simple values such as strings, integers, or lists of strings and integers. The format of the preference key in the repository depends on the backend module that is used to read the repository. The following is an example of the /desktop/gnome/interface/font_name preference key when an Extensible Markup Language (XML) backend module is used to read the repository:
When this guide refers to a preference key, the path to the key is added to the name of the key. For example, the font_name preference key in the /desktop/gnome/interface subdirectory is referred to as /desktop/gnome/interface/font_name.
The GConf repository contains a series of storage locations that are called configuration sources. The configuration sources are listed in the GConf path file. The location of the GConf path file is /etc/gconf/gconf-version-number/path. Each user has a path file. The path file specifies the following information for each configuration source:
The GConf path file also contains include instructions. By default, the contents of the GConf path file are as follows:
When GConf searches for a preference value, GConf reads the configuration sources in the order specified in the path file. The following table describes the configuration sources in the path file:
Configuration Source | Description |
---|---|
Mandatory | The permissions on this configuration source are set to read only. Users cannot overwrite the values in this source, so the preferences in the source are mandatory. |
User |
This configuration source is stored in the .gconf directory in the home directory of the user. When the user sets a preference, the new preference information is added to this location. You can use the Configuration Editor to modify the user configuration source. |
Default | This configuration source contains the default preference settings. |
The sequence of the configuration sources in the path file ensures that mandatory preference settings override user preference settings. The sequence also ensures that user preference settings override default preference settings. That is, GConf applies preferences in the following order of priority:
The include instructions in the GConf path file enable system administrators to specify other configuration sources.
Included Configuration Source | Description |
---|---|
/etc/gconf/2/local-mandatory.path | Use this configuration source to store mandatory preference values for a particular system. |
$(HOME)/.gconf.path | The user specifies the location of the configuration source in the home directory, in a file that is called .gconf.path. |
/etc/gconf/2/local-defaults.path | Use this configuration source to store default preference values for a particular system. |
A GConf schema is a collective term for a GConf schema key and a GConf schema object. The following table describes schema keys and schema objects and the relationship of these items to preference keys:
Item | Description |
---|---|
Preference key | An element in the GConf repository that corresponds to an application preference. |
Schema key | A key that stores a schema object for a preference key. |
Schema object |
An element in a configuration source that contains information for a preference key, such as the following:
|
The following table gives examples of a preference key, a schema key, and a schema object:
Item | Example |
---|---|
Preference key | /desktop/gnome/interface/font_name |
Schema key | /schemas/desktop/gnome/interface/font_name |
Schema object |
<schema>
<applyto>/desktop/gnome/interface/font_name</applyto>
<key>/schemas/desktop/gnome/interface/font_name</key>
<owner>gnome</owner>
<type>string</type>
<default>Sans 10</default>
<locale name="C">
<short>Default font</short>
<long>Name of the default font used by gtk+.</long>
</locale>
</schema>
|
You can associate a schema key with a preference key. For example, the following /desktop/gnome/interface/font_name key includes a schema key:
When you associate a schema key with a preference key, the preference uses the suggested value that is specified in the schema object of the schema key. The suggested value is contained in the <default> element in the schema object. By default, all the preference keys in the default configuration source are associated with schema keys.
Typically, schemas are stored in the default configuration source.
Schemas are generated from schema definition files. A schema definition file defines the characteristics of all of the keys in a particular application. Schema definition files have a .schemas extension.
The schema definition files are included in the /etc/gconf/schemas directory. You can use the schema definition files to create a new configuration source.
Some schema definition files correspond closely to a part of the GNOME Desktop user interface. For example, system_http_proxy.schemas corresponds to the Network Proxy preference tool. Other schema definition files contain preference keys that are not present in the GNOME Desktop user interface. For example, the /apps/panel/global/tooltips_enabled key is not present in the user interface.
Some parts of the GNOME Desktop user interface contain preferences that represent preference keys from more than one schema definition file. For example, the Keyboard Shortcuts preference tool contains preferences that represent keys from the panel-global-config.schemas and metacity.schemas files.