Hi Nicholas,
Nicolas Williams wrote:
> On Thu, Feb 14, 2008 at 02:52:33PM -0800, John Fischer wrote:
>> The command xdg-user-dirs-update is run very early in the
>> login phase. This program reads a configuration file, and a set of
>
> How early?
At start up of the session, it's an autostart script that is run by
gnome-session.
>
>> default directories. It then creates localized versions of these
>> directories in the users home directory and sets up a config file in
>> $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to
>> ~/.config) that applications can read to find these directories.
>
> "It then creates localized versions of these directories..."
>
> Really?
>
> So if I log in using a different locale than my usual then I'll end up
> with new directories that I'll never use when I go back to my usual
> locale?! That doesn't sound right. Or will
> $(XDG_CONFIG_HOME)/user-dirs.dirs allow me to avoid this issue
> altogether?
Sorry, to be clearer, on first-run it will create the directories, on subsequent
runs (even in alternative locales) it will avoid creation of new directories
based on the configuration in the user-dirs.dirs file.
>
> But I see that it's hard to do much better. Declaring some English
> words to be well-known directory names that get localized by the GUIs
> will probably be very difficult to implement in all the right places,
> and confusing when some GUI fails to localize them.
Yes, that's one of the problems it aims to address.
>
> If we assume that most users are not multi-lingual (much less polyglots)
> then I think this is probably OK.
Hmm - it's obviously enough of an issue that someone came up with a generic
solution - but it's also important to note that this is not just about locale,
but also addresses the variation of the names of these directories in different
freedesktop.org compliant desktops (e.g. KDE, GNOME, xfce).
>
> What do other operating systems do about this problem?
In Windows it's not really been much of an issue since it has had with a
different install set for each language - but I believe that this has been fixed
in Vista, but I've not experienced it enough to confirm.
As for MacOS/X - I also have little experience with it in this regards.
>
>> Sysadmins can configure things by editing /etc/xdg/user-dirs.conf.
>
> How will this be documented?
Via manpage for xdg-user-dirs-update, but maybe there is sufficient need for a
separate manpage, e.g. user-dirs.conf?
>
>> At the moment there are only two settings, you can disable the whole
>> thing, and you can specify the charset encoding used for filenames.
>
> Why should a charset be specified here? Presumably the *language* to
> localize these directory names to comes from the locale chosen by the
> user, so why can't the charset come from the locale too?
In GNOME, the charset used for filenames is always utf-8 encoded (it can be
overridden if needed through environment variables).
In the case of XDG user dirs, it is not a GNOME applications, but desktop
independent, hence it doesn't use glib, so we need a way to configure the
charset to use - that is the purpose of setting the charset at the system level.
Saying that, we actually wouldn't expect this to be changed much, and should
always be utf-8.
>
>> They can also set or change the default directories and their initial
>> values in /etc/xdg/user-dirs.defaults.
>
> How will this be documented?
>
>> $(XDG_CONFIG_HOME)/user-dirs.dirs specifies the current set of
>> directories for the user. This file is in a shell format, so its easy
>> to access from a shell script. This file can also be modified by
>> users
>> (manually or via applications) to change the directories used.
>
> How will this be documented?
Both will be documented in the xdg-user-dirs-update manpage.
>
> What's XDG_CONFIG_HOME?
It's ${HOME}/.config by default.
>
> What should this shell script do? Set variables? Will these be
> exported? What will read this file? Will shell scripts read this file?
> If so, what credentials and privilege will those shell scripts be
> running with?
It simply sets variables, attached is a sample - it isn't run by default, only
parsed programatically. Should someone decided to source it, they will have to
export the variables themselves, should they desire to.
Thanks,
Darren.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: user-dirs.dirs
URL:
<http://mail.opensolaris.org/pipermail/opensolaris-arc/attachments/20080219/3859e25c/attachment.ksh>