Tuesday, May 22, 2018

Fix Firefox downloads files associations

When clicking downloaded files in Firefox they may be opened by the wrong applications.

Source: here.


 

 
When clicking a downloaded file in the list of downloaded files Firefox will use the first program listed in the line application/pdf= of the file usr/share/applications/mimeinfo.cache, which is set not by the default/system settings for that file-type (e.g: the default application for pdf was Okular, but that line was application/pdf=inkscape.desktop;okularApplication_pdf.desktop;, so that Firefox opened the files in Inskape instead of the default Okular.)
A solution is to modify that line or, even better (because that would not be overridden by other newly installed applications) to create a per-user file ~/.local/share/applications/mimeinfo.cache with lines like (example for pdf):

[MIME Cache] 
application/pdf=okularApplication_pdf.desktop;

The disadvantage of the above is that it is a per-file-type setting. To have a solution for all files, use the first commands posted above.

In case that stops working, be sure "Always ask" is selected under `about:preferences` in Firefox and then re-do the steps above.

A more radical change would be to remove the undesired application and/or reinstall the desired application (last installed takes over).
 
cd .local/share/applications/
ln -s mimeapps.list defaults.list


No comments:

Post a Comment