I had Ubuntu-14.04 installed in a minimum configuration, i.e. with no X Windows support. Later I added x-server packages for my card, and a lightweight WindowManager (I don't want KDE or GNOME), so I normally launch X with startx, however someone keeps on creating Documents, Desktop, Download, Video, Music etc. directories in my $HOME. I thought this isually done by "advanced" desktop environments. What application/daemon can be behind this anyways?
2 Answers
This is carried out by the xdg-user-dirs
1 package.
The file /usr/bin/xdg-user-dirs-update
is run at logon and creates the files based on defaults in /etc/xdg/user-dirs.defaults
, or if it exists $HOME/.config/user-dirs.dirs
.
If you want to disable it, the setting is in /etc/xdg/user-dirs.conf
, or uninstall the package, if dependencies allow.
1: The package name was xdg-user-dirs-update
on Ubuntu. On Fedora and Arch it is xdg-user-dirs
, same as on Ubuntu (at least since 20.04).
-
thanks for response, I've removed packages 'xdg-*' however two still remain: xdg-user-dirs and xdg-user-dirs-gtk. Even 'apt-get autoremove' doesn't help. Who is holding them?– MarkMar 15, 2016 at 14:00
-
I don't know. I tried
sudo apt-get remove xdg-user-dirs
on my test VM and it offered to remove it. Mar 15, 2016 at 17:51 -
'apt-get remove xdg-user-dirs' say "package is not installed, so not removed". Also, 'dpkg -l | grep xdg' adds 'rc' at the beginning of the line. What does it indicate? (I know that 'ii' would mean "installed")– MarkMar 15, 2016 at 19:23
-
1Run
dpkg -S */xdg-user-dir
. It should show you all packages that provide files named/xdg-user-dir
. Hopefully, it'll give you a clue. Mar 15, 2016 at 21:52 -
1If you follow the vertical lines above
rc
it show you what they mean.r
is forRemove
andc
is forConf-files
. What this means is that the package has been removed, but the config files haven't. You need to purge the package -sudo apt-get purge xdg-user-dirs
to remove them. Mar 15, 2016 at 21:55
These directories are specified by Freedesktop under the name xdg user directories. It's used by quite a few applications, not just the most in-your-face desktop environments.
There is a utility xdg-user-dirs-update
which creates these directories if they're missing. You can try to track the invocations of this utility, but that's a lost cause: sooner or later an application will want one of these directories and create them all. On Ubuntu at least, it's called from the session startup scripts that are executed whenever you start an X session, and you can't suppress that without dirty tricks (or being root).
To get the directories out of the way, edit ~/.config/user-dirs.dirs
and set them to the paths you like. The only one that you can't really change is XDG_CONFIG_HOME=~/.config
, because that's used to find the user-dirs.dirs
file.