Setting “Desktop” to be ~/Documents/Desktop

xdg is a unix thing that tells you where “important” folders are. Such as Documents, Music, Desktop, etc.
A simple (and documented example in the Ubuntu conf file) would be to have subfolders. To emulate windows I could say that Desktop=Documents/Desktop in /etc/xdg/user-dirs.defaults
However if Documents or Desktop is a mount point bad things happen. It just defaults Desktop=Home. Actually it does work randomly…a race condition between pam_mount and xdg I suppose. Not that xdg creates folders if they don’t exists…at least it usually does. So the issue isn’t that the folder doesn’t exists. Just look in /etc/skel there is no Desktop folder.
There is a command xdg-user-dirs-update that can reset these if you pass –force. It works! Run it, go to nautilus, click desktop and it shows you Documents/Desktop in the mount point! However it does not refresh nautilus desktop so the actual desktop still points to Home. One could fix it manually in this terrible hack.
Edit ~/.profile or /etc/skel/.profile for new users too, add to it
/opt/xdgfix.sh&
Now create a file /opt/xdgfix.sh and make it
sleep 6
xdg-user-dirs-update --force
killall nautilus
nautilus -n&

That’s sleep 6 seconds, update our xdg user dirs, stop nautilus, start nautilus.

So what good is xdg if it doesn’t work reliably? It seems to have totally erratic behavior in each version of Ubuntu. Before 12.04 it just wouldn’t ever work with mount points. Now we have sometimes kinda works….some progress 🙁

Of course this is just one problem out of many that stem for Linux having nothing even remotely close to Windows Folder Redirection which if you haven’t guessed is what I’m trying to painstakingly emulate.

Leave a Reply

Your email address will not be published. Required fields are marked *

*