well-known user folders, a proposal

Shaun McCance shaunm at gnome.org
Fri Feb 23 07:36:01 PST 2007


On Thu, 2007-02-22 at 12:11 +0100, Alexander Larsson wrote:
> Here is how it works:
> Somewhere (early) in the login scripts we run the command
> xdg-user-dirs-update. It reads a config file (/etc/xdg/user-dirs.conf)
> and a list of user dir defaults (/etc/xdg/user-dirs.defaults). (By
> default, it also respects the xdg basedir spec env vars.) It also loads
> the current user dir configuration (~/.config/user-dirs.dirs) if it
> exists.
> 
> For each default specified dir type (DESKTOP, DOWNLOAD, etc) that is
> not already in the user config the we create the directory and add it
> to the config file. The directory name used is based on the config
> file, but we also use gettext with the translations from the package
> to translate pathname elements.
> 
> Some old directories (like ~/Desktop) are special cased such that a
> translated version of them are not created if the old one exists
> already. This gives some backwards compatibility.
> 
> If a user-configured directory doesn't exist anymore (i.e. the user
> deleted it) we don't recreate it, instead we change the setting to
> point it to $HOME for this dir. This means that its effectively
> disabled, and apps work as they do now (defaulting to $HOME).
> 
> There is also a --force flag that ignores any existing user settings
> and just creates and sets up localized dirs. This is useful if there
> has been a new translation added and you want to update to that. We
> can't really do this automatically since the old filename might be
> stored in all sorts of places.

When we've discussed things like this on desktop-devel-list
in the past, it's been said that people sometimes log in the
first time in English, because they don't know any better,
and then subsequently log in in their own language.

This method would cause the English folders to be created
early in the first login, precluding them from getting the
proper translation later.  Users, by and large, won't know
they can run `xdg-user-dirs-update --force`, so they'll be
stuck with those folder names.  I don't know what to do to
solve this.

One other point is that I don't think users can be expected
to edit a config file to change their folders.  We should
strongly advise that file managers automatically update the
user config file when the user renames the folder.  We can't
do anything about `mv` obviously, but we can do what we can.

--
Shaun





More information about the xdg mailing list