Comment 11 for bug 285998

Revision history for this message
Joshua Riffle (rampageai) wrote : Re: A misplaced ~/Templates folder over a reboot permanently changes the TEMPLATES path in ~/.config/user-dirs.dirs

This may be related to this bug or possibly a separate bug. I can re-file this comment if necessary. I have created a script in the /etc/X11/Xsession.d folder that is numbered to run *before* the xdg-user-dirs-update script. My script detects whether or not the Desktop and Documents folders have been replaced with an appropriate folder symbolic link of the same name and if it they haven't then it replaces them. However, the user-dirs-update script apparently "detects" that the actual folders have been replaced and forces nautilus to use the $HOME folder in ~/.config/user-dirs.dirs for both of them instead of the appropriate symlink. The strange part is it will only complain that they have been replaced with symlinks if xdg-user-dirs-update is run from within a script or sourced, but it will actually give the correct folders if it is run directly from the command-line. If it is run from the command-line it will *not* update the user-dirs.dirs file but if I delete the user-dirs.dirs file completely it will replace it and if it is sourced or run within the script then it does actually seem to update the user-dirs.dirs file though with $HOME instead of the correct folders.