8

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?

12

This is carried out by the xdg-user-dirs-update1 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 above is for Ubuntu. On Fedora and Arch it is xdg-user-dirs.

  • 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 Mar 15 '16 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. – garethTheRed Mar 15 '16 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 Mar 15 '16 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. – garethTheRed Mar 15 '16 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. – garethTheRed Mar 15 '16 at 21:55
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.