1

I want to set custom locations for Document, Pictures, Videos and Music folders in elementary OS. This is the method I followed.

/etc/xdg/user-dirs.conf

# This controls the behaviour of xdg-user-dirs-update which is run on user login
# You can also have per-user config in ~/.config/user-dirs.conf, or specify
# the XDG_CONFIG_HOME and/or XDG_CONFIG_DIRS to override this
#

enabled=False

# This sets the filename encoding to use. You can specify an explicit
# encoding, or "locale" which means the encoding of the users locale
# will be used
filename_encoding=UTF-8

~/.config/user-dirs.dirs

# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 
XDG_TEMPLATES_DIR="$HOME/Templates"
XDG_PUBLICSHARE_DIR="$HOME/Public"
XDG_DOWNLOAD_DIR="/media/user/Media/Downloads"
XDG_DOCUMENTS_DIR="/media/user/Media/Documents"
XDG_MUSIC_DIR="/media/user/Media/Music"
XDG_PICTURES_DIR="/media/user/Media/Pictures"
XDG_VIDEOS_DIR="/media/user/Media/Videos"

I used the command xdg-user-dirs-update after editing these files. And also tried logging out and in and restarting the system too. But nothing worked. The pantheon-files still goes to the default $HOME/Documents path.

Can anyone tell what's wrong here or another workaround to achieve my purpose?

2
  • pantheon-files goes there by default or if you click on Documents?
    – lemonslice
    Dec 31, 2016 at 14:35
  • @lemonslice When I click on Documents on left navigation pane it goes to /home/user/Documents not to the custom destination /media/user/Documents which was set by me. Like wise Pictures, Music and Videos goes to the default /home/user/<> directory. Dec 31, 2016 at 17:22

3 Answers 3

3

This works for me: 1. Set enabled=True in /etc/xdg/user-dirs.conf 2. Edit ~/.config/user-dirs.dirs as required. 3. Log out and back in 4. In Files, delete the bookmarks to the old directories (which will no longer have the special icons) and create new ones to the new user directories (which will now have the special icons and breadcrumbs).

0

Just create symbolic links to the places that you prefer. For example I use a 2TB HDD mounted at /media/backuphd to which I symlinked the usual folders in my home folder:

ln -s /media/backuphd/MyDocs /home/me/Documents
ln -s /media/backuphd/MyPics /home/me/Pictures

and so on. This way you may keep all your documents and pictures even if you migrate your OS.

0

This works for me - I have replaced the directories with symbolic links to the new locations, manually edited the ~/.config/user-dirs.dirs file in order to return the settings back to the default, because after reboot the system do not recognized the symbolic links and point them to the $HOME into the .dirs file and once I set enabled=False into the /etc/xdg/user-dirs.conf they remain unchanged after reboot, so the icons and locations are ok.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.