May, 2010

6
May 10

Making Chromium use correct default applications

Loads of people seem to be having this problem, but not many people actually seem get around it. This works for me.

My environment:

  • Fedora 12 x86_64
  • Chromium 5.0.382.0
  • Running xmonad window manager

Chromium uses xdg-open to open file types it isn’t associated with. After a quick dig through the script, I saw that xdg-open tries to open the file using mimeopen, falling back to using run-mailcap and finally resorting to calling `$BROWSER $1`.

I don’t have mimeopen or run-mailcap installed and I noticed that my $BROWSER environment variable wasn’t set. When that is the case xdg-open looks up and tries to use a basic list of web browsers, one of which is htmlview (this is why Chromium is launched when you try to view PDFs).

I simply set my $BROWSER environment variable to gnome-open, which is smart enough to know what to with a file or URI. If you go down this route, remember to make sure the variable is set for all your browser shells.