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
Now create a file /opt/ 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.

By David

I am a supporter of free software and run Burke Software and Consulting LLC. I am always looking for contract work especially for non-profits and open source projects. Open Source Contributions I maintain a number of Django related projects including GlitchTip, Passit, and django-report-builder. You can view my work on gitlab. Academic papers Incorporating Gaming in Software Engineering Projects: Case of RMU Monopoly in the Journal of Systemics, Cybernetics and Informatics (2008)

Leave a comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: