Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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: bugs.launchpad.net/pcmanfm/+bug/1031463 –  user76204 Oct 31 '12 at 18:51
    
i'm using the default Unity2D –  sybreon Nov 4 '12 at 4:18
add comment

5 Answers 5

There exists an autostart script

/etc/xdg/autostart/user-dirs-update-gtk.desktop

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
add comment

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
add comment

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.

e.g.

 cd ${HOME}
 function link() {
 local dir=$1
 shift 1
 [ -e ${dir} ] || mkdir -p ${dir}
 for name in $*
 do
 if [ -L ${name} ]
 then
 if [ "$(readlink ${name})" = "${dir}" ]
 then
 [ -e  "${dir}" ] || mkdir -p "${dir}"
 echo "${name} allready converted to ${dir}"
 else
 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}
 fi
 else
 if [ -d ${name} ]
 then
 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}"
 else
 ln -sv ${dir} ${name};
 echo "${name} linked to ${dir}"
 fi
 fi
 done

 }


 #     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
add comment

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
add comment

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
add comment

Your Answer

 
discard

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.