Odd Gnome problems, or, what happened to my icons?

20 February 2009

While upgrading Windbringer's systemware yesterday, I suddenly ran across a rather odd problem: all of the icons on my Gnome desktop suddenly turned into the default Gnome "blank page with a corner folded down" icon, which meant that Gnome wasn't able to figure out what sort of file a launcher really was. Even more oddly, the names of the launchers themselves turned into (for example), "gtkpod.desktop" rather than "GTKpod", which meant that double-clicking on anything resulted in the contents of the launcher being opened in a text editor. Everything inside of the Gnome application menu could still be executed normally; adding a launcher to the panel rather than the desktop worked normally, also.

Re-emerging various Gnome components didn't fix anything. Logging out and back in again didn't fix anything; rebooting didn't fix anything. Killing and manually restarting Nautilus (which is the application that actually manages the desktop) didn't help, either. Logging out and erasing my ~/.gnome directories so that they'd be recreated when I logged back in didn't work. I spent some time talking to the folks on the Gentoo IRC channel, and while I got some good ideas none of them worked (thanks anyway, though).

What it wound up being was a bad directory of MIME mappings, which are basically a set of rules that say "If you see a file that looks like this, it's a file of type x-mime-foobar, so to make use of it you should do this-and-such.." In my case, the MIME mapping for .desktop files got messed up somehow, and Gnome forgot how to interpret each launcher (like a shortcut in Windows) properly. In addition to a set of MIME mappings that are considered canonical across the entire system (kept in the directory /usr/share/mime on Windbringer), each user has a set of their own which are kept in ~/.local/share/mime, which can be updated whenever the system deems it necessary. In my case, running the command /usr/bin/update-mime-database /usr/share/mime didn't work, which localized the trouble to my personal set of mappings.

What I wound up doing was logging out and erasing my ~/.local/share/mime directory. That fixed the problem but due to the fact that I had erased my ~/.gnome
directories earlier, I had to re-do a lot of my desktop (mostly moving icons around to put them in order).

This seems to be an uncommon but frustrating problem that follows Gnome upgrades from time to time, so by all means spread this info around where it'll do the most good.