Hi Danek,

Danek Duvall wrote:
> On Thu, Feb 14, 2008 at 02:52:33PM -0800, John Fischer wrote:
> 
>>         XDG User Dirs is a tool to help manage "well known" user directories
>>         like the desktop folder and the music folder. It also handles
>>         localization (i.e. translation) of the filenames.
> 
> What management does it do, other than translating the names?

It maintains correct pointers to the directories, even if you happen to change
locale between when you first logged in and when you next log in.

> 
> When it does do translation, what does that mean?  Does it create a symlink
> from "Mein Musik" to "My Music"?  Does it rename the directory?

It doesn't create a sym-link. By default, it does nothing, only ensures that a
reference to such a directory will find it, e.g.

- If you log in in German, you will have the directory:

        Musik

- If you then log in using English, a call to g_get_user_special_dir(
G_USER_DIRECTORY_MUSIC ) will return ${HOME}/Musik rather than ${HOME}/Music

There is a separate project, which will be integrated later, not now, called
xdg-user-dirs-gtk that addresses handling the possible change of these
directories to the current locale, firstly prompting the user on what their
preference is.

> 
>>         Typically these directories are accessed in applications using the
>>         Committed glib 2.14 function:
>>         
>>             g_get_user_special_dir()
> 
> Do applications have to do something different to access the new directory
> names, or does g_get_user_special_dir() use the xdg files to figure out
> where to look?

g_get_user_special_dir() uses the XDG_ environment variables (e.g
XDG_DOCUMENTS_DIR) or if that's not set, it will parse the value out of the
${HOME}/.config/user-dirs.conf.

> 
>>         $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to
>>         ~/.config)
> 
> That seems *awfully* generic.  Is that the standard value on real Linux
> systems?

True, it is, but that's currently what is already in place on Linux, and
Solaris, where this is currently already being used to store user-specific
preferences for things like:

- auto start programs
- user-specific modification to menus

The reason for the generic name, I'm guessing is that it's not specific to the
desktop, but is meant to be independent of it. (GNOME, KDE and xfce desktop
environments use these settings).

Thanks,

Darren.

Reply via email to