I learned a few useful things while helping a chap troubleshoot a problem in #ubuntu-us-mi today. It seems that VLC had taken over as the default program for opening folders and directories on his Ubuntu computer, and he couldn’t figure out how to fix it. He found that if he uninstalled VLC, then the folders opened correctly again, but this was not really a solution as he needed VLC.
After some Googling, I found out where the default programs for each file type are specified, and also where the user-specific programs are set:
System Defaults: /usr/share/applications
User Specific: ~/.local/share/applications
Most GUI programs that can open a file have a .desktop entry in those folders. The actual file type to program mappings are in the following text files:
System Default: /usr/share/applications/defaults.list
User-Specific Overrides: ~/.local/share/applications/mimeapps.list
My mimeapps.list looks like this (note that I have both Ubuntu and Kubuntu installed):
In his mimeapps.list, the user had a line like:
After deleting that entry in his mimeapps.list normal behavior was restored.
One other observation is that the line was unchanged when VLC was uninstalled. So Gnome simply skipped over the vlc.desktop when it couldn’t find the program and used the next one in line to open folders.