GConf Repository
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:
Directories that correspond to applications that use the GConf repository. For example, the file system contains the
directory /apps/metacity.
Subdirectories that correspond to categories of preferences.
For example, the file system contains the directory /apps/metacity/general.
Special files that list the preference keys in the directory,
and contain information about the keys. For example, a file that contains
information about the keys that relate to the HTTP proxy preferences is in
the directory /system/http_proxy.
A /schemas directory that contains files
that describe all of the preference keys.
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:
<entry name="font_name" mtime="1038323555" muser="user123" type="string">
<stringvalue>Sans 10</stringvalue></entry>
| Note |
---|
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. |
GConf Configuration Sources
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 backend module to use to read the repository.
The permissions on the repository.
The location of the repository.
The GConf path file also contains include instructions. By default, the contents of the GConf path file are as follows:
xml:readonly:/etc/gconf/gconf.xml.mandatory
include /etc/gconf/2/local-mandatory.path
include "$(HOME)/.gconf.path"
include /etc/gconf/2/local-defaults.path
xml:readwrite:$(HOME)/.gconf
xml:readonly:/etc/gconf/gconf.xml.defaults
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:
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:
Mandatory preferences
User-specified preferences
Default preferences
The include instructions in the GConf path file enable system administrators to specify other configuration
sources.
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:
The following table gives examples of a preference key, a schema key,
and a schema object:
You can associate a schema key with a preference key. For example, the
following /desktop/gnome/interface/font_name key includes
a schema key:
<entry name="font_name" mtime="1034873859"
schema="/schemas/desktop/gnome/interface/font_name"/>
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.
GConf Schema Definition Files
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.