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?
2 Answers
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
-
I went into the .config directory and there was no user-dirs.dirs May 7, 2015 at 17:39
-
@It'sWillem open terminal:
file .config/user-dirs.dirs
what output you get for this? May 7, 2015 at 17:45 -
-
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)
man xdg-user-dirs-update