# GConf Conventions

This chapter describes conventions that GConf clients should obey, though the library does not enforce them.

# Namespace division

When choosing GConf keys, you should follow these conventions.

- Schemas should go under the `/schemas` toplevel directory. Under `/schemas`, the normal GConf namespace should be mirrored. So, if you have a key `/foo/bar/baz`, the schema for that key should be at `/schemas/foo/bar/baz`. If you apply the same schema to multiple keys, then obviously the schema name will have to differ from the key names; but you should mirror as much of the key names as possible. For example, `/foo/bar/baz` and `/foo/bar/boo` might have the schema `/schemas/foo/bar/baz_and_boo`.

- The GNOME libraries may store preferences for GNOME apps under the `/apps/gnome-settings/`appname`` directory. ``appname`` will be replaced with the name of your app, as passed in to `gnome_init()` (perhaps canonicalized to be a legal GConf key). You should not put your own settings in this directory, because you may get notifications when gnome-libs keys change and gnome-libs may get notifications when your keys change. This would be confusing.

- Preferences for applications should go under an `/apps/`appname`` directory. Try to make ``appname`` match the one passed to `gnome_init()`, also used in the `/apps/gnome-settings/`appname`` directory. Vendors are encouraged to include their vendor name in `appname`, to avoid namespace clashes.

- Preferences for the desktop environment should go under `/desktop`. None should be immediately under `/desktop`, however. GNOME-specific preferences should be under `/desktop/gnome`. Settings standardized among multiple desktops should go under `/desktop/standard`. Other specific desktops should select a directory to use (`/desktop/kde`, `/desktop/xfce`, etc.)

- System-level preferences (such as the host name, though I'm sure that specific example will never be in GConf) should go under `/system`. None should be immediately under `/system`, however; select a descriptive subdirectory.

- In general, keys under `/system` and `/desktop` are for use by multiple applications, and keys under `/apps/`appname`` are for use by a single application.

- If you have a "weird" key that doesn't fit into any of the above categories, please mail me (`<hp@redhat.com>`) and ask for a new directory to be invented. Alternatively, place your key under the `/extra` toplevel directory.