Ubuntu - permanently remove ~/Videos and ~/Public
I've deleted the folders, but every time I sign back in they're recreated. I've edited ~/.config/user-dirs.dirs
and removed the offending lines, but they're replaced when I log back in! The file say's it's auto-generated by /usr/bin/xdg-user-dirs-update
, but that seems to be a dead end.
Three files control the "personal special folders" behaviour:
~/.config/user-dirs.dirs
- allow the user to specify a custom path for the special folders. So you can have youMusic
folder in, say, "$HOME/My Music", or "/datapartition/mp3". Its does not allow you to "disable" those folders. If you delete one line (or the whole file), default values will be used, as you have already noticed./etc/xdg/user-dirs.conf
(overrided by~/.config/user-dirs.conf
) - Allows you to enable or disable the automatic folder (re-)creation. If you setenabled=False
, either globally or for your own user only, special folders will not be re-created at login anymore in case you delete or rename the folders./etc/xdg/user-dirs.defaults
- Global template for folders path and name. This is the file read when~/.config/user-dirs.dirs
is re-created. Be aware that changing default names will prevent folder names to be localized (translated) if you change your Language/Locale.
By the way, the service you disabled was just the daemon that would offer to rename the folders in case you changed your Language/Locale.
Your problem has been explained at the software wiki
Settings
Sysadmins can configure things by editing /etc/xdg/user-dirs.conf. At the moment there are only two settings, you can disable the whole thing, and you can specify the charset encoding used for filenames. They can also set or change the default directories and their initial values in /etc/xdg/user-dirs.defaults.
$(XDG_CONFIG_HOME)/user-dirs.dirs specifies the current set of directories for the user. This file is in a shell format, so its easy to access from a shell script. This file can also be modified by users (manually or via applications) to change the directories used. Note: To disable a directory, point it to the homedir. If you delete it it will be recreated on the next login.
So your ~/.config/user-dirs.dirs
could be modified as
XDG_DOWNLOAD_DIR="$HOME"
XDG_TEMPLATES_DIR="$HOME"
XDG_PUBLICSHARE_DIR="$HOME"
XDG_DOCUMENTS_DIR="$HOME"
XDG_MUSIC_DIR="$HOME"
XDG_PICTURES_DIR="$HOME"
XDG_VIDEOS_DIR="$HOME"
On at least Ubuntu 18.10, you can just remove the directories and run the following command in a terminal:
xdg-user-dirs-update
The entries will be reassigned to home and disappear from the list under Files.
It is actually a daemon that creates those folders, check the startup preferences, its on the system menu i believe, you can easily disable that feature.