Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have multiple users on my home desktop. I am content with most of the default user directories, however I would like to make one change.

I would like to setup a common directory for Music (ie /home/common/Music/) that is writable to all users and Nautilus/Dolphin/whatever recognizes as the user's Music directory.

I know that it would involve changing the xdg user directory setup, but everything I see points that it is relative to the user's $HOME. Is there a way I can specify an absolute path?

share|improve this question
add comment

2 Answers 2

up vote 8 down vote accepted

Yes to do what you need you simply need to change the xdg configuration for each existing user like so:

~/.config/user-dirs.dirs

XDG_DESKTOP_DIR="$HOME/Desktop"
...
XDG_MUSIC_DIR="/home/common/Music"
XDG_VIDEOS_DIR="$HOME/Movies"

And to make this something available to all users created simply edit this:

/etc/xdg/user-dirs.defaults

DESKTOP=Desktop
...
MUSIC=../common/Music
VIDEOS=Videos

To modify the permissions, this bit is tricky because you need to make sure that all files created in these directories remain editable by everyone. I found this interesting guide on the subject:

http://www.centos.org/docs/2/rhl-rg-en-7.2/s1-users-groups-private-groups.html

Which suggests doing the following to make the permissions sticky as well as adding the users all to a common group:

chown nobody:users /home/common
chmod 2775 /home/common
usermod -a -G users user1

You may want to change the umask setting to allow all files created to be modifiable by the anyone in the users group in that directory, edit /etc/profile and go to the bottom and change umask 022 to umask 002 This is considered secure since all users have their own primary user and really only effects shared directories like this one you want to make.

Let us know if it works well enough.

share|improve this answer
add comment

Alternatively you could set up /home/common/Music (with suitable permissions) and then use a symlink from /home/usernames/Music to /home/common/Music.

To do this right click on /home/common/Music (after the permissions on it are set up) and click Make Link. Now move this link to each users home folder and rename it to Music.

alt text

Note: all file managers will understand symbolic links. But above is the Nautilus method of creating such links. I'm sure doing the same thing would be equally intuitive in Dolphin.

This avoids changing the xdg configuration at all.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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