I have a simple problem: Whenever I delete the templates folder in my home directory (/home/[username]/ in case that info is of use) it seems to come back. It contains nothing and I have no use for it. Is there a way to make it go away permanently?
Asked
Active
Viewed 2,467 times
3
A.B.
- 89,123
- 21
- 245
- 323
It's Willem
- 931
- 4
- 13
- 31
-
What version of Ubuntu are you using? I've just deleted my Templates directory and restarted - it's not come back. – Carl H May 06 '15 at 18:27
-
They can come back, depending on your configuration/desktop environment. They're called "XDG user directories". I have no time to delve into it now, but you can search starting from `man xdg-user-dirs-update` – Rmano May 06 '15 at 18:32
-
2Run ` sed -i.bak 's/^XDG_TEMPLATES_DIR/#&/' ~/.config/user-dirs.dirs` and then remove it.....now restart and check.. – heemayl May 06 '15 at 18:35
-
I'm on 12.04, why? – It's Willem May 07 '15 at 17:39
-
Add a tag with your Ubuntu version – A.B. May 07 '15 at 17:39
-
@A.B I did, it is the first one – It's Willem May 07 '15 at 17:41
-
Yes, it just added. https://askubuntu.com/posts/620223/revisions – A.B. May 07 '15 at 17:42
2 Answers
5
In your home folder is a configuration file ~/.config/user-dirs.dirs:
nano ~/.config/user-dirs.dirs
with a content like this:
[..]
XDG_DESKTOP_DIR="$HOME/Desktop"
XDG_DOWNLOAD_DIR="$HOME/Downloads"
XDG_TEMPLATES_DIR="$HOME/Templates"
[..]
You can comment out the line by which the folder will automatically create:
before:
XDG_TEMPLATES_DIR="$HOME/Templates"
after
#XDG_TEMPLATES_DIR="$HOME/Templates"
Or you can use a single command in a terminal:
sed -i.bak 's/^\(XDG_TEMPLATES_DIR=\)/#\1/' ~/.config/user-dirs.dirs
This can be undone:
sed -i.bak 's/^#\(XDG_TEMPLATES_DIR=\)/\1/' ~/.config/user-dirs.dirs
In both cases, a backup of your file will be created:
~/.config/user-dirs.dirs.bak
A.B.
- 89,123
- 21
- 245
- 323
-
-
@It'sWillem open terminal: `file .config/user-dirs.dirs ` what output you get for this? – Alex Jones May 07 '15 at 17:45
-
-
2
As said by A.B., you must edit the configuration file:
nano ~/.config/user-dirs.dirs (use nano, vim or another text editor)
After that, remove the desired directories and edit the file:
sudo nano /etc/xdg/user-dirs.conf.
In this file, you must set enabled=False to avoid the system create these directories when logging in again.
(I found this information on https://superuser.com/questions/223918/ubuntu-permanently-remove-videos-and-public)
Vinícius Valente
- 51
- 1
- 4