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 want to move Template directory out from my ~ home folder. I would like to have one global Template directory. One option, that I think can be possible is to create a link(shortcut or how is it called in linux) to Template, but then Template file would still be in my folder and I don't know where to put global Template folder, where is a place, that should be used by it (maybe /opt?). So basically:

  • Is it possible to create one global Template folder instead of Template for every user? And how? (by one, I mean, that I'm able to remove Template folder from every user).

If not:

  • Where should I put a folder with templates, where is a good place for putting my global configurations in linux?

EDIT: I checked and put my global Templates folder in /opt/Template, then I made a link from every user account to that place and it works fine, but still I have no idea, if it is possible to get rid of Template folder (or link) completely in user's home folders.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

enter image description here

It is indeed possible to create a global template folder as the picture shows.

To do this you can edit the file ~/.config/user-dirs.dirs

Change the line XDG_TEMPLATES_DIR="$HOME/Templates" to XDG_TEMPLATES_DIR="/opt/Templates" if your global folder is in /opt/Templates

Note 1 - you should consider carefully the permissions you give this template folder. I would suggest you should give read-only rights with a common group shared by those users of a client. Obviously try to avoid 777 rights to this folder since this makes the folder read-writable to everyone and anyone.

Note 2 - the XDG_TEMPLATES_DIR folder needs to be EITHER a folder locate in the users home or an absolute folder (full path to the folder starting with /)

Note 3 - you dont necessarily need to modify user-dirs.dirs. You could remove the local home-folder and soft-link it to your global templates folder i.e.

cd ~/
rmdir Templates
ln -s /opt/Templates Templates

Note 4 - logout and login for changes to take effect

share|improve this answer
    
great. For an opt and Templates I made 755, for files inside Templates I made 744. Everything works perfectly. Do I need to change user-dirs,dir or soft-link folder every time I create a new user? Or is there any way to automate this process? –  Benjamin Jul 2 '12 at 22:37
1  
@Benjamin - according to this Q&A - you need to put your modified .config/user-dirs.dirs into /etc/skel - there are some very useful links in the accepted answer as to how to customise new user accounts. askubuntu.com/questions/83532/… –  fossfreedom Jul 2 '12 at 22:50
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.