Changing User Directory Names In Gnome And KDE

Don't like the way Gnome calls it "Documents" instead of, say, "doc"? This is how to fix it.

[2010-06-29]

I've been using Linux for a little while now -- since before Gnome and KDE created those useful user directories like "Documents" and "Pictures" and "Videos", etc. And, frankly, I have always preferred my directory naming convention.

I try to apply the kind of conventions found in the Filesystem Hierarchy Standard to my home directory, because I like that /usr/share/doc is called /usr/share/doc and not, say, /usr/share/docs, or /usr/share/Documents, or, for that matter, /Users/Shared Files/Shared Documents. I like my keyboard, and my command line, and short directory names are easier to type. But I acknowledge that nice, big, long directory names are more friendly, and if you're using a GUI 99% of the time, you're not usually going to be typing them anyway.

These directories are the result of standards established by the excellent work of freedesktop.org. And your computer will have software to manage them.

You can find their configuration in ~/.config/user-dirs.dirs. If you look inside there with "cat" or your favourite editor, you'll see what's happening. You can either edit the file directly, or you can use the xdg-user-dirs-update command.

Here's how I renamed my Documents directory:

$ mv ~/Documents ~/doc
$ xdg-user-dirs-update --set DOCUMENTS ~/doc

"DOCUMENTS" does need to be capitalised. It needs to match the middle bit of "XDG_DOCUMENTS_DIR" as it appears in the user-dirs.dirs file. If you look at the user-dirs.dirs file again, you'll see the change has been made. Repeat for any other directories you want to rename. When you're done, notify GTK of your changes with

$ xdg-user-dirs-gtk-update

and if you edited the file directly, you'll also need to go

$ xdg-user-dirs-update

That's it. Now that you have directory names you prefer, if you use Gnome you might want to update your "Places" to reflect your new names. These are found in ~/.gtk-bookmarks.

The .gtk-bookmarks file also offers aliases for the directories. So, in your favourite editor, you could change the line that refers to Documents to something like ...

file:///home/norman/doc Documents

(... obviously substituting "/home/norman" with your own home directory).

Now your directory is called "doc" and its bookmark says "Documents". You have the best of both worlds; directory names that are easy to type, and "Places" that are easy to read!