26

In previous releases of Ubuntu, I used Ubuntu Tweak to change the paths to the user folders (Music, Documents, Videos, etc). I can't find an option in Gnome 3 to do this, and Ubuntu Tweak's ppa still has no version for Oneiric.

muru
  • 197,895
  • 55
  • 485
  • 740
jerivas
  • 342

3 Answers3

42

Open a terminal and write this command:

gedit ~/.config/user-dirs.dirs

Each row is a user folder definition (music, video...), edit as you want. For example, I did not want the videos folder in home, but in a separate disk, and changed the XDG_VIDEOS_DIR parameter this way:

XDG_VIDEOS_DIR="/media/share/Video"

OR simply run:

xdg-user-dirs-update --set VIDEOS "/media/share/Video"

Logout and login back to effect properly.

Stefano
  • 2,384
  • 4
    To make it effective immediately, run xdg-user-dirs-update. – sup Jul 10 '12 at 15:36
  • after i restart or unplug my external disk the folders disappear from that list. any idea how to solve that? http://askubuntu.com/questions/251624/set-default-folders-to-external-hdd-permanently – duxk.gh Feb 05 '13 at 14:42
  • From the manual for xdg-user-dirs-update I'm guessing that it goes back to the default directories if they exist, so just delete them and it should be good – Arthur Spoon Mar 14 '18 at 23:27
  • @ArthurSpoon Unfortunately, no, this (e.g. deleting ~/Documents) doesn't stop the overwriting of the tweaked user-dirs.dirs file. – mike rodent Jun 28 '18 at 09:37
4

As at today (7 years later!), my experiments seem to show:

  1. These variables are set in the file ~/.config/user-dir.dirs relate to XDG, which stands for "X Desktop Group"... i.e. they appear to relate to the "windowing" processes. But for example, none of these variables are then accessible by the user (or root) as an environment variable

  2. It appears that the variable XDG_DOCUMENTS_DIR is the one which is responsible, in Nemo, for giving one particular directory a "special" icon

  3. That's what we're all bothered about: how to give one particular directory a special icon all to itself, signifying "this is your DOCUMENTS directory"

  4. To give this to a particular directory other than ~/Documents,
    -- a. make a link from the directory you want under "My Computer" in the LH panel of Nemo
    -- b. change the value of the XDG_DOCUMENTS_DIR variable in ~/.config/user-dir.dirs to this directory, using an absolute path.
    -- c. log out and back in: whatever its name may be, in both the LH and RH side of Nemo your directory should now have the "special" DOCUMENTS icon!

NB it is not sufficient, as suggested in a comment above, simply to delete the ~/Documents directory for everything to work OK. Bear in mind in particular that, if at startup it is found that the XDG_DOCUMENTS_DIR path actually doesn't lead to a valid directory, the setting for XDG_DOCUMENTS_DIR will be overwritten in user-dir.dirs, replacing it, in principle, with $HOME/Documents... (in fact, oddly, my experiments seem to find that it is usually replaced with $HOME, for some inexplicable reason).

NB2 as an alternative to the above (especially if the "special" icon doesn't matter in particular to you), you could use a symlink ... which you can call "Documents". In fact, you could have both: a symlink and a special icon for your target file.

NB3 I don't believe you can make a symlink as suggested ... AND give it a special DOCUMENTS icon! But given this, all seems to be about cosmetics anyway maybe it, um, doesn't matter much!

James
  • 103
  • 2
mike rodent
  • 168
  • 7
2

You can still install Ubuntu Tweak and do it with that, if you dont want to mess around with the terminal.

Eliah Kagan
  • 117,780