well-known user folders, a proposal
fcrozat at mandriva.com
Thu Feb 22 04:44:12 PST 2007
Le jeudi 22 février 2007 à 12:11 +0100, Alexander Larsson a écrit :
> I'd like some feedback from the various desktop projects. Do you think
> this is an important area to standardize? Does my approach make sense?
> Is my code full of holes?
I'd like to share our experience at Mandriva regarding standard user
folders and problem we found when trying to implement this system (we
did it with Mandriva Linux 2006) :
After reading extensively the discussions on this subject in the various
GNOME ml, we decided the following set of functionnalities we wanted to
implement, both in GNOME AND KDE :
-give users predefined directories in their home to store their data :
Download, Documents, Music, Pictures and Video (this is newbie
-allow quick access to these directories from the various file selectors
-allow those directories to be distinguished when using file manager
(nautilus, konqueror) with a different icon, but handled as standard
-only display localized names in the UI
-be able to access those directories now or in the future using scripts
without too much trouble even if they are localized.
-if users choose to delete these directories, they should not come back
or be displayed in any UI anymore
-if possible, applications save/load difectories should be using those
directories by default.
So, our initial implementation was doing the following :
at first login, create directories with english name on disk in $HOME,
also create .desktop file in $HOME, with localized name and pointing to
those directories and add those .desktop file to ~/.gtk-bookmarks.
-no need to patch applications / environment too much to get something
-the english names were always visible, even in non english locale
-removing the desktop file was not removing the directories
To try to fix some problems, we changed implementation :
-at first login, a directory called ~/.mdk-folders is created
-we create real directories with localized name on disk in $HOME and we
create symlink in ~/.mdk-folders to those directories, symlink name
being the english name (easier scripting if needed)
-we create .desktop file in ~/.mdk-folders pointing to those directories
-we add .directory file in the created directories, allowing konqueror
to display a nice icon for those directories (unfortunately, it can't be
done in nautilus and shouldn't, it adds performance penalty too).
-we patched KDE file selector to search for .desktop file in
~/.mdk-folders and add them as shortcuts in file selector
-we add those .desktop file in ~/.gtk-bookmarks
We are still not entirely satisfied with this solution, which is way too
hackish : I had to patch nautilus and gnome-panel to teach them to
handle .desktop in ~/.gtk-bookmarks correctly), Nautilus is not
displaying nice icons for those folders, it doesn't work if you switch
locales after first login and it doesn't scale very much. Also, we
didn't have time to make sure applications would use relevant
directories (Music for RB, Pictures for Gimp, etc..).
We didn't hear many complains (from people who want to organize their
own way) nor many "this is so cool", maybe because integration is not
So, to answer your concerns, Alex :
-"Do you think this is an important area to standardize?" : YES.
-Is localised filename on disk a good idea ? : YES (for reasons you
stated and from our own experience)
-encoding : for our (Mandriva) solution, since we hadn't switched to all
locales to UTF-8 at that time, we were using charset from current locale
(using "locale charmap")
-set of directories : here is our own list : documents, download, music,
So, in short, I warmly welcome your move on this subject. This is
something which was still pending on my TODO list and I never found
enough time to bite the bullet.
PS : I didn't have time to check your code yet..
Frederic Crozat <fcrozat at mandriva.com>
More information about the xdg