Changing the default file handler in XFCE on Debian

Since reinstalling my computer, I’ve been getting annoyed that PDF files are being opened in the GIMP, rather than ePDFview, which is more useful. I’ve finally been annoyed enough to work out where to change this. The “Preferred Applications” settings dialog only sets a few basic types. So I needed to wander round the MIME information stuff.

A quick google for stuff┬áhad lots of people saying “Right click in Thunar, select ‘Open with other application’ and pick the application and set it as default”. There already were applications listed, I didn’t want to change too much. I then found this post on StackExchange, which didn’t quite make sense with my filesystem. Then I worked out what to do…

I had an empty mimeinfo.cache file in <home>/.local/share/applications, but the one in /usr/share/applications had all of the MIME types listed. Including one line for PDF files:

application/pdf=gimp.desktop;gimp.desktop;epdfview.desktop;

So I copied this into the local user file, changed the first program listed to epdfview.desktop, and tried it. It worked. Obviously, this only changes it per user, but it means that it’s not likely to be overwritten by a package upgrade later.

Maybe doing the “Select as default” option is better. I’ll have to try it next time I need to do this. But, I now know how to modify it manually when I mistakenly set JPG files to open in Totem, or something equally stupid.