What is the relationship between .gconf, .gnome2, .cache, .local, and other dot-file hierarchies in my home directory?

7,055

Solution 1

.local, .cache, and .config are part of the FreeDesktop Base Directory Specification. They should not actually be hard-coded but instead use the environment variables (i.e. $XDG_DATA_HOME, $XDG_CACHE_HOME, and $XDG_CONFIG_HOME). There are GLib and Python wrappers for the spec that may be helpful as well. Here's an example in Python:

>>> import xdg.BaseDirectory
>>> print xdg.BaseDirectory.xdg_data_home
/home/andrew/.local/share
>>> print xdg.BaseDirectory.xdg_config_home
/home/andrew/.config
>>> print xdg.BaseDirectory.xdg_cache_home
/home/andrew/.cache

.gnome and .gnome2 are indeed deprecated and should not be used. These were used by libgnome's gnome-config module.

.gconf does indeed contain the settings that gconf-editor accesses as xml files. For instance, compare the output of the following commands:

gconftool -a /desktop/gnome/applications/browser

cat ~/.gconf/desktop/gnome/applications/browser/%gconf.xml

Solution 2

The proper phrasing should be that .local, .cache, etc are part of the XDG Base Directory Specification of FreeDesktop, http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html.

The XDG Base Directory Specification is a standard, and is followed by KDE and other compliant environments.

Share:
7,055

Related videos on Youtube

belacqua
Author by

belacqua

Updated on September 17, 2022

Comments

  • belacqua
    belacqua over 1 year

    According to this answer, .local .cache and .config are, by convention, configuration storage locations adopted by Gnome and Ubuntu.

    Are .gnome .gnome2 and .gconf therefore legacy configuration directories, or are they supposed to co-exist?
    And does the adoption of dconf alter these dot-file application config conventions?

    Finally, what is the relation of the gconf-editor data settings to these directories? Do .gnome/.gconf contain the same info that gconf-editor accesses?

    Updates: XDG has been pointed to as the reason for .cache, .local, and .config.

    This question on dconf advises that dconf will be the replacement for gconf, as documented on Gnome.org . Furthermore, João says that dconf is the

    GNOME technology used to store application settings. [...] dconf is the GNOME3 replacement for gconf which has not been maintained for some time. dconf is also expected to bring performance improvements over gconf (relevant for applications startup).

    I expect, based on that that there will be a somewhat anarchic migration path from gconf settings to dconf. I would love to hear any additional perspectives.

  • belacqua
    belacqua over 13 years
    What does it mean to be compliant? Is there a mandate to convert apps using a different specification to the XDG one, or otherwise to leave them out of the Gnome/KDE base install? If so, is the mandate enforced? Are non-compliant third-party apps flagged by someone, or is the existence of different config conventions/dirs assumed to be a given, that is, something that will continue until voluntarily abandoned by all ecosystem developers? I don't have KDE installed, but base Ubuntu/Gnome for my 10.10 system has the XDG dirs you mention. Perhaps this is voluntary compliance?
  • red.clover
    red.clover over 13 years
    For the most part it is voluntary compliance, but there has been discussion in the past about making XDG compliance a "goal" for all application in the default install.
  • teambob
    teambob about 12 years
    I came across your answer when trying to find how to find the configuration directory from a gtk application. For other programmers who come after me there is a gtk(glib) wrapper which uses XDG on Linux and also handles MS Windows. Specific information here: developer.gnome.org/glib/2.30/…
  • red.clover
    red.clover about 12 years
    Right you are. I was mostly just being descriptive in this answer, not providing hands on examples for a programmer. I'll update the answer to add a little more info for those who stumble across this.
  • MestreLion
    MestreLion over 11 years
    It is voluntary compliance, but users can (and many do) fill bug reports on non-compliant apps requesting them to adhere to the standard. Un-cluttering their $HOME folder is one of the greatest benefits of the XDG standard, so user pressure is usually quite high on legacy apps.