15

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 2

18

This is carried out by the xdg-user-dirs1 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).

5
  • 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?
    – Mark
    Commented Mar 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. Commented 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")
    – Mark
    Commented Mar 15, 2016 at 19:23
  • 1
    Run 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. Commented Mar 15, 2016 at 21:52
  • 1
    If you follow the vertical lines above rc it show you what they mean. r is for Remove and c is for Conf-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. Commented Mar 15, 2016 at 21:55
3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .