I had mentioned my encounter with some new directories in Ubuntu 7.10, the Gutsy Gibbon:
These showed up on an upgrade from 7.04 Feisty Fawn and on a fresh install of 7.10. On installs of previous versions, there has been the Desktop folder, and I’ve kept that around as a special dir that is actually linked to the desktop somehow. (Saved items in ~/Desktop will show up on the GNOME desktop.)
I was put off at first by these, concerned that we might be moving in to the Microsoft territory of “My Documents” and “My Favorites” types of folders, and rigid expectations of where we should put things, but after some investigation they don’t seem like such a bad idea, and they’re not all that intrusive. You can make as much or little or no use of them as you want. (I’m happy that the developers stayed away from the infantilizing “My” label, and clearly,
/home/scarpent/Documents is much preferable to
C:\Documents and Settings\scarpent\My Documents.)
I noticed the Documents, Music, Pictures, and Videos directories showed up as items in the “Places” menu, and also in dialogs like File “Save As…”. My first reaction was to remove them, since I have my own places I like to keep these things. After deleting them, the Places menu simply stopped showing them. No complaints. It was quite painless. (Windows would have warned me about drastic consequences and begged me not to touch them.)
But I had become curious about why these had been added and where the GNOME developers were going with this. I thought it might be useful to have my Places menu and file save dialogs include shortcuts to the locations where I actually keep these things. For new users, I don’t think there’s anything wrong with providing common folders in their home dir up front that they can start using, and that applications can know about and default to opening or saving different kinds of files in a likely location. My searches uncovered a lot of information, but nothing that brought it all together for me. Here is some of what I found, in the hopes of helping other searchers. Apologies for the vagueness of it all. I’m just getting my head around these different features and configurations.
I first found an Ubuntu Forums thread pointing to freedesktop standards as the source of these directories, pointing out that this isn’t necessarily Ubuntu specific. Something to do with an XDG Base Directory specification. (Also see freedesktop.org and the freedesktop.org Wikipedia entry.)
Someone in the Ubuntu forum mentioned editing
~/.config/user-dirs.dirs to change the defaults. I immediately seized on this as the key and spent a lot of time trying to configure my own dirs there, but couldn’t tell if my changes were having any effect. In fact, I thought my changes there were having no effect because I expected them to be reflected in the Places menu. I was thoroughly confusing two different things. I thought the Places menu entries and the “Save As” dialogs (a GTK widget?) were tied to this as well, but that is another thing: gtk-bookmarks. So when I updated my user-dirs.dirs file, and ran
xdg-user-dirs-update, I couldn’t see any visible effect of my actions. Either applications aren’t using user-dirs.dirs much yet, or I just don’t know which ones take advantage of it.
So I spun my wheels for a while with
user-dirs.dirs. There is a freedesktop.org page on xdg-user-dirs, which mentions
/etc/xdg/user-dirs.defaults, and I played around with the defaults also. I found another discussion where someone pointed out that if you move or rename these directories in Nautilus, that the user-dirs.dirs file would be updated, and I saw that this was true.
I’m sure it is a good idea to keep user-dirs.dirs in sync with the actual directories I use, but it turns out that what I had really been trying to do was figure out was how the Places menu worked. (Or at least one part of the Places menu.) For that, I discovered the
~/.gtk-bookmarks file, which starts out looking like:
file:///home/scarpent/Documents file:///home/scarpent/Music file:///home/scarpent/Pictures file:///home/scarpent/Videos
You can modify or add new entries in this format, and they’ll automatically appear in the Places menu. If the directory doesn’t exist, Places won’t list it.
What further confused me was that it seemed like OpenOffice.org 2.3 was using user-dirs.dirs to determine it’s default save directory. It would pick ~/Documents if that dir existed, but wouldn’t pick the new dir that I assigned in user-dirs.dirs. After a while it occurred to me to check in the OO.o config, and I then saw it had its own setting for a data directory.
Has this helped at all? It seems like there is some work to do in this area. I can imagine it’s hard to develop new desktop standards and get everyone to agree on how configuration should be handled for these things, including adding GUI support. The nice part again is that it’s relatively unobtrusive. No one is dictating that they should be used. There is potentially some annoyance if the directories are created when not wanted and not needed, but once user-dirs.dirs is set with the user-specific directories I’m hoping that future upgrades won’t keep recreating the defaults.
Related: Ubuntu 7.10 Gutsy Gibbon Swings In