Restoring your Desktop folder in Ubuntu
This morning one of the Ubuntu workstations at work began to perform incredibly bad. It seems there was some kind of problem with the workstation and the user that works everyday with it just rebooted the machine (everybody know a reboot is the solution to all the problems you could find in a computer... ains...).
After the reboot, she found that the desktop wallpaper and all the icons were gone. She came to me and asked me if I could take a look and I did.
After some tests and a lot of log parsing (thnk god Ubuntu developers didn't get rid of /var/log/* yet) I found that there was a problem with the ext3 filesystem, and some inodes were deleted during the reboot (urgh!). It seems those inodes were related to the contents in the Desktop folder (where all the desktop items are stored). When she started a new gnome session, the system picked up a folder called Desktop within another folder in the user's home directory (Why? I've no idea... and I don't know why a folder called Desktop was in there.). Then I moved the Desktop folder to $HOME and restarted the gnome session (hey, it seemed like a reasonable solution to me) just to find out that the system was then using the whole home folder as the desktop (and all the contents in the home folder were spread all over the screen).
After some more digging, I tried removing all the .gnome2, .gconf, .gconfd, .nautilus, etc config files and directories and I checked that, in the gconf editor, nautilus had not activated the "Use your home folder as the desktop folder" option. Nothing worked.
But, in the end, I found ~/.config/user-dirs.dirs. It seems to be Ununtu-specific and it is a file where you can set not only your desktop folder, but your pictures/movie/public/etc folders (those you would find in your home after your first login in a Ubuntu workstation). The contents of that file were:
# This file is written by xdg-user-dirs-update # If you want to change or add directories, just edit the line you're # interested in. All local changes will be retained on the next run # Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped # homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an # absolute path. No other format is supported. # XDG_DESKTOP_DIR="$HOME" XDG_DOWNLOAD_DIR="$HOME" XDG_TEMPLATES_DIR="$HOME/Plantillas" XDG_PUBLICSHARE_DIR="$HOME/Público" XDG_DOCUMENTS_DIR="$HOME/" XDG_MUSIC_DIR="$HOME/Música" XDG_PICTURES_DIR="$HOME/" XDG_VIDEOS_DIR="$HOME/"
So, I only had to change it a little bit:
XDG_DESKTOP_DIR="$HOME/Escritorio" XDG_DOWNLOAD_DIR="$HOME/Escritorio" XDG_TEMPLATES_DIR="$HOME/Plantillas" XDG_PUBLICSHARE_DIR="$HOME/Público" XDG_DOCUMENTS_DIR="$HOME/" XDG_MUSIC_DIR="$HOME/Música" XDG_PICTURES_DIR="$HOME/" XDG_VIDEOS_DIR="$HOME/"
To get it working properly again (after logging out and logging in again in the gnome session).