8

In kubuntu ,the default programs associated with mime types in mozilla products are completely different from the system-wide setting or user setting. For example, firefox/thunderbird will always use krita to open pdf, but for all other programs such as dolphin will open it correctly via okular

It seems consistent with the /usr/share/applications/mimeinfo.cache:

application/pdf=kde4-krita_pdf.desktop;kde4-okularApplication_pdf.desktop;gimp.desktop

However, the xdg-mime query default application/pdf gives out a correct value: okularApplication_pdf.desktop

And in dolphin->"file type options", it gives a correct priority list: Okular, Gimp, Imagemagick, krita

Is there anyway to make firefox/thunderbird use the correct xdg-mime value instead of the wrong mimeinfo.cache?

Or is there any way I can just copy the correct data into mimeinfo.cache?

Thanks

Wang
  • 956

3 Answers3

11

Finally I figured it out: The Mozilla applications are going to look through list of files for mime-type-app associations in following order:

~/.local/share/applications/mimeapps.list
~/.local/share/applications/mimeinfo.cache
/usr/local/share/applications/mimeapps.list
/usr/local/share/applications/mimeinfo.cache
/usr/share/applications/mimeapps.list
/usr/share/applications/mimeinfo.cache
/usr/share/applications/defaults.list

Actually they should not use mimeinfo.cache at all. Because there is no order in these files. In some distro there will be default mimeapps.list which is nice. But many distros does not have default mimeapps.list. In some distro there is no mimeinfo.cache at all. Thus in these distros it falls back to /usr/share/applications/defaults.list which works fine. But in ubuntu, there are still mimeinfo.caches, which will be automatically generated after each updates. In kubuntu it is even worse, because the associations in defaults.list are specified to gnome apps but not KDE ones.

The good way to solve this is to generate my own mimeapps.list and put it into ~/.local/share/applications/.

Wang
  • 956
0

Based on @Wang's answer, I decided to investigate on my machine why this wasn't working.

I found that when you use Dolphin to set file assosciations, the changes get saved to the non-standard location "~/.config/mimeapps.list".

Creating a symlink from this file to one of the expected files that Firefox looks for seems to have resolved this issue:

ln -s ~/.config/mimeapps.list ~/.local/share/applications/mimeapps.list

After running this command and restarting firefox, it appears to be following my file assosciation preferences finally!

0

Firefox lets you set the helper programs yourself. Go to Preferences => Applications and set accordingly :

enter image description here

Not sure about thunderbird, I don't use it, but there is probably a similar setting in the attachments section.

terdon
  • 54,564