You are not logged in.

#1 2015-07-30 00:08:34

bigeast
Member
Registered: 2013-04-19
Posts: 9

How to manage the default applications to open files in Firefox?

How to control the default applications to open the downloaded files in Firefox? It seems that the system's xdg-open is not used.

In Preference->Applications, I can set the action when firefox handle a pdf file, I choose "Preview in Firefox", but there's also a "Use evince(default)" item, so after I download a pdf file and click it, evince will open it. But I want other program to open the PDF file, say MuPDF. In "Use others", I choose "/bin/mupdf", but how can I set it to default?

Offline

#2 2015-07-30 00:50:35

bigeast
Member
Registered: 2013-04-19
Posts: 9

Re: How to manage the default applications to open files in Firefox?

bigeast wrote:

How to control the default applications to open the downloaded files in Firefox? It seems that the system's xdg-open is not used.

In Preference->Applications, I can set the action when firefox handle a pdf file, I choose "Preview in Firefox", but there's also a "Use evince(default)" item, so after I download a pdf file and click it, evince will open it. But I want other program to open the PDF file, say MuPDF. In "Use others", I choose "/bin/mupdf", but how can I set it to default?

I choose "Always Ask", and next time when I open a url to a PDF file, I can choose to open it with MuPDF and check "Do this automatically for files like this from now on".

Since I want to preview the pdf in Firefox first, then download it if I really need it, then maybe open it with an external application that I can control by clicking on the file name in Firefox's download list, so I choose "Preview in Firefox" back.

Now the default external application for PDF file do change into MuPDF, but the "(default)" string still come after "Use evince"(should be "Use mupdf(default)").

And, there are two download list in Firefox, the short one and the detailed one. In the short one, i.e. the one which show up when I click the download icon, external application open files, while in the one after I click "Show All Downloads", files are previewed in Firefox.

What a mess! Why so complicated! The Preferences->Applications->Action is confusing me.

Can someone please explain the logic behind it for me and how can I do what I want?

Offline

#3 2015-07-30 10:36:23

manuelschneid3r
Member
From: Germany
Registered: 2013-04-14
Posts: 152

Re: How to manage the default applications to open files in Firefox?

Check the wiki article on default applications.

.:[ manuel@argon ]:. ~ $ cat .config/mimeapps.list 
[Default Applications]
application/pdf=evince.desktop;zathura-pdf-mupdf.desktop
audio/x-vorbis+ogg=rhythmbox.desktop
...

You have to change the value behind your mimetype. E.g application/pdf. Now get the correct name of the desktop file and write it behind it. For this verifiy the name of the desired desktop entry with the desktop entries in /usr/share/applications, /usr/local/share/applications  or ~/.local/share/applications.

find {/usr,/usr/local}/share/applications ~/.local/share/applications/ -iname "*.desktop"

Fallbacks are appended, separated by semicolon.

Imho the mimetype handling in linux is far from mature. Every now and then I unite all "*mimeapps.list" on my system to /etc/xdg/mimeapps.list and delete the rest. This may be handy for you

find / -iname "*mimeapps.list" -exec cat {} \;| sort -u > new-mimeapps.list

Now open the file, put "[Default Applications]" on top, delete all other braced expressions, check the associations and store it to /etc/xdg/mimeapps.list.

Last edited by manuelschneid3r (2015-07-30 10:56:46)


Please feel free to correct my english.

Offline

Board footer

Powered by FluxBB