Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a weird problem with 12.04 LTS.

Regardless of what I do to the ~/.config/user-dirs.dirs file, whenever I login again the next time, that file gets all set to $HOME only. Something is happening during login using lightdm that overrides the contents of that file.

If I login and do a xdg-user-dirs-update --force then the contents of the file are OK. After I logout, the file is still OK. It's when I login again using lightdm that something goes wrong.

It's quite annoying.

share|improve this question
Which desktop environment are you using? There was a bug filled here recently: – user76204 Oct 31 '12 at 18:51
i'm using the default Unity2D – sybreon Nov 4 '12 at 4:18

There exists an autostart script


Which calls the program xdg-user-dirs-gtk-update, which appears to have no man page or --help explanation, but I am guessing might be the cause.

You can either delete this script (which appears to belong to the package xdg-user-dirs-gtk, and may be recreated if it is updated), or add a line Hidden=true to the autostart file, which should prevent it running (and you should be asked if you want to keep your modified copy during any future updates).

share|improve this answer
I did something similar, but created a script in /etc/X11/Xsession.d/ to overwrite the XDG resets. – sybreon Nov 21 '12 at 4:51

Googling your problem led me to xdg-user-dirs, which may be installed from the Ubuntu Software Center. It claims the following feature:

This program reads a configuration file, and a set of default directories. It then creates localized versions of these directories in the users home directory and sets up a config file in $(XDG_CONFIG_HOME)/user-dirs.dirs (XDG_CONFIG_HOME defaults to ~/.config) that applications can read to find these directories.

The full documentation can be found here.

share|improve this answer
that's not the solution as the problem is that these files are somehow 'reset' after each login. – sybreon Nov 4 '12 at 4:17

I suggest to check the following points:

  • Try to check if XDG_CONFIG_HOME is set to a different location as '~/.config`.
    • on shell level
    • via grep XDG_CONFIG_HOME /etc/*profile /etc/*rc ~/.*rc ~/.*profile /etc/X11/Xsession /etc/X11/Xsession.d/*

As as workaround use symbolic links between the standard and your custom directory names.


 cd ${HOME}
 function link() {
 local dir=$1
 shift 1
 [ -e ${dir} ] || mkdir -p ${dir}
 for name in $*
 if [ -L ${name} ]
 if [ "$(readlink ${name})" = "${dir}" ]
 [ -e  "${dir}" ] || mkdir -p "${dir}"
 echo "${name} allready converted to ${dir}"
 echo "${name} (link) converted to ${dir}"
 [ -e  "${dir}" ] || mkdir -p "${dir}"
 mv -av ${name}/* ${dir}/ 2>/dev/null    || true # can be emtpy
 mv -av ${name}/.??* ${dir}/ 2>/dev/null || true # can be emtpy
 rm -f ${name}
 ln -svf ${dir} ${name}
 if [ -d ${name} ]
 mv -av ${name}/* ${dir}/ 2>/dev/null    || true # can be emtpy
 mv -av ${name}/.??* ${dir}/ 2>/dev/null || true # can be emtpy
 rmdir ${name}
 ln -sv ${dir} ${name};
 echo "${name} (dir) converted to ${dir}"
 ln -sv ${dir} ${name};
 echo "${name} linked to ${dir}"


 #     real                DE          EN
 link  ~/data/templates    Vorlagen    Templates
 link  ~/data/public       Öffentlich  Public
 link  ~/data/documents    Dokumente   Documents
 link  ~/data/music        Musik       Music
 link  ~/data/photo        Bilder      Pictures
 link  ~/data/video        Videos
 link  ~/data/privat       Privat
share|improve this answer
for the moment, i've got a work-around to force the directories using a /etc/X11/Xsession.d/ script. – sybreon Nov 20 '12 at 15:44

The entries would get reset if the custom dirs do not exist when the update runs. Is it possible that your home dir is not mounted until late in the login process? Maybe you can set the defaults in /etc/xdg/user-dirs.defaults so that it gets rewritten to the same paths anyway?

share|improve this answer
the user home dir is a glusterfs mount that is mounted during boot.. so, it's available when the user logs in. – sybreon Nov 20 '12 at 15:44

After making the changes and saving the file but before you log back in, execute

echo "enabled=false" > ~/.config/user-dirs.conf

This creates user-dirs.conf that should prevent any further reset.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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