[fhs-discuss] My Confusion between GLib: enum GUserDirectory and XDG Base Spec: $XDG_DATA_DIRS

Lennart Poettering lennart at poettering.net
Mon May 23 05:50:06 PDT 2011


On Sun, 22.05.11 18:55, Randy Kramer (rhkramer at gmail.com) wrote:

> 
> (Still cc'ing the list.)
> 
> Lennart,
> 
> Thanks for your response!  That prompts some additional questions or 
> comments:
> 
>    * So, if I want to separate what I call my real user data (which in 
> terms of the definitions in GLib, would be the files that I'd put in 
> the "members" of the GUserDirectory enum), from all the other garbage 
> that ends up in $HOME, the way to do that would be to have all the 
> directories like   G_USER_DIRECTORY_DESKTOP,  
> G_USER_DIRECTORY_DOCUMENTS, ... in $HOME, and then set 
> things like $XDG_CONFIG_HOME, $XDG_CACHE_HOME, $XDG_RUNTIME_DIR, and 
> $XDG_DATA_HOME to locations not in $HOME?

You never get to set XDG_RUNTIME_DIR on your own. That should be done by
your OS.

But sure, you can set those env vars as you suggest otherwise.

>    * At least partially at my instigation, it is intended (there is a 
> bug filed) that FHS 3.0 will include a reference to the XDG Base 
> Directory Specification in the /home section.  I'm not sure that is 
> sufficient anymore.  I'm thinking that there should be some reference 
> to the directories in the GUserDirectory enum.  What do you think?

Sure, why not.

>    * What does XDG stand for?  (Has it changed since its inception?)

I think it stands for "XDG Desktop Group" now. Recursive and
stuff. Consider it synomymous to fdo.

>    * Comment--now I see from that GLib document on Miscellaneous Utility 
> Functions that it really is the intention that things like icons 
> customized for a particular user really are intended to go in 
> $XDG_DATA_HOME.  (Somehow, looking at the XDG Base Directory 
> Specification, and not being aware of the GLib: Miscellaneous Utility 
> Functions document nor the wiki document on Software/xdg-user-dirs, I 
> expected that my "real user" data would go in  $XDG_DATA_HOME (I mean 
> things like documents, photos, ...).

Icons is app data, not user data. Hence xdg-user-dirs is not the right
place for it.

The fact that xdg-user-dirs is not specified in an XML docbook but in a
wiki page has no influence on the validity of it. Consider it having the
same relevance as xdg-basedir.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the fhs-discuss mailing list