Change default user folders path?

44,418

Solution 1

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.

Solution 2

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!

Solution 3

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

Share:
44,418
jerivas
Author by

jerivas

Updated on September 18, 2022

Comments

  • jerivas
    jerivas over 1 year

    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.

  • sup
    sup almost 12 years
    To make it effective immediately, run xdg-user-dirs-update.
  • duxk.gh
    duxk.gh over 11 years
    after i restart or unplug my external disk the folders disappear from that list. any idea how to solve that? askubuntu.com/questions/251624/…
  • Arthur Spoon
    Arthur Spoon about 6 years
    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
  • mike rodent
    mike rodent almost 6 years
    @ArthurSpoon Unfortunately, no, this (e.g. deleting ~/Documents) doesn't stop the overwriting of the tweaked user-dirs.dirs file.
  • abu_bua
    abu_bua almost 6 years
    Please format you post regarding to this link: askubuntu.com/editing-help