Base directory specification

Vincent Untz vuntz at gnome.org
Mon Mar 26 09:32:12 PDT 2007


Le lundi 26 mars 2007, à 09:23, Brian J. Tarricone a écrit :
> On Mon, 26 Mar 2007 17:12:12 +0200 Sanel Zukan wrote:
> 
> >Hi to all,
> >
> >I am currently implementing Base directory specification for EDE,
> >according to documentation located at:
> >http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html
> >
> >There is stated: "If $XDG_DATA_HOME is either not set or empty, a 
> >default equal to $HOME/.local/share should be used." 
> >
> >Here is, at least for me, unclear whether desktop should set
> >$XDG_DATA_HOME, $XDG_CONFIG_HOME, etc. when they are not present and
> >point them to default locations ?
> >
> >I checked in Xfce and KDE, and I find out that Xfce sets some of them, 
> >but KDE does not at all.
> 
> We (Xfce) set the ones that make our startup scripts easier.  It's up
> to the applications to also know what the defaults should be in case
> some (or all) of them aren't set.
> 
> For an app-level implementation, never assume that the desktop
> environment (if any!) has set the XDG_* env vars.  Just hard-code the
> defaults and use those for variables that are unset.  You can choose to
> have EDE set them or not on desktop startup, but the applications should
> to be able to handle the case where they're not set.

Also, if you use glib, you can use g_get_user_data_dir() and
g_get_user_config_dir(): those functions use the default values if the
environment variables are not set. I imagine other libraries have
similar functions.

Vincent

-- 
Les gens heureux ne sont pas pressés.



More information about the xdg mailing list