5

Each time I changed and saved .config/user-dirs.dirs, and after restarted the system, the XDG_DOWNLOAD_DIR are reverted:

diff --git a/.config/user-dirs.dirs b/.config/user-dirs.dirs
index 8f6e2db..dcff34e 100644
--- a/.config/user-dirs.dirs
+++ b/.config/user-dirs.dirs
@@ -7,11 +7,9 @@
 # 
 XDG_PUBLICSHARE_DIR="$HOME/public"
 XDG_TEMPLATES_DIR="$HOME/public/template"
-
 XDG_DESKTOP_DIR="$HOME/private/desktop"
 XDG_DOCUMENTS_DIR="$HOME/private/doc"
 XDG_PICTURES_DIR="$HOME/private/picture"
 XDG_MUSIC_DIR="$HOME/private/music"
 XDG_VIDEOS_DIR="$HOME/private/video"
-
-XDG_DOWNLOAD_DIR="$HOME/var/downloads"
+XDG_DOWNLOAD_DIR="$HOME/"

How to make my changes permanent?

2
  • What do you want to do? Add dirs to places? If so have a look at ~/.gtk-bookmarks
    – Rinzwind
    Jun 13, 2011 at 8:12
  • @Rinzwind: I want to set the default download dir to $HOME/var/downloads, permanently.
    – Lenik
    Jun 13, 2011 at 15:21

4 Answers 4

10

I think this is the proper way to do it:

xdg-user-dirs-update --set DOWNLOAD $HOME/var/downloads
5

See xdg-user-dirs in Ubuntu Software Center:

It sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs. Change the default directories and their initial values in /etc/xdg/user-dirs.defaults. The values are relative pathnames from the home directory.

5

Create .config/user-dirs.conf:

enabled=False
filename_encoding=UTF-8

You could see the explanation on /etc/xdg/user-dirs.conf

0

I know this is an old thread, still I think I can share something that might be relevant, as this helped me greatly.

Instead of dealing with XDG and configs, it is possible to create a symlink for all the user-folders that are in $HOME, which also makes it easier for some programs to find the path, as some programs fx. point to the $HOME/Music directory, and if they can't find that music folder, they just point to $HOME (bummer).

By creating a symlink, it's possible to circumvent this problem, and then the programs searching for $HOME/Music will find it, but all that happens in $HOME/Music, will be stored at another place.

Lets assume your username is "John", then this is what needs to be done:

sudo ln -s /Target/folder/Location /Folder/That/Should/Point/To/Target

Target folder can be the desired location of Music, fx. on an attached drive with the number JHG76H, and folder that should point to Music can be a default music folder in home, like this:

sudo ln -s /home/John/Music /media/John/JHG76H/Music

Change the paths according to needs, as this was just a pseudo drive number and username, and in my experience, this can be used for pretty much any drive or folder location, as long as there is access. Doing this didn't alter the content in target folder for me (as expected), but still use with caution.

PS: $HOME is another way of writing /home/YourUserName

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .