How to set default browser for PDF reader Evince on Linux?

Solution 1:

As far as I understand LXDE uses xdg to do calls to applications. This command should fix your issue:

To find out which application opens a pdf file :

xdg-mime query default application/pdf

To set the application to evince

xdg-mime default evince.desktop application/pdf

This should work if your application is registered to the desktop (i.e. if there is a launcher)

Solution 2:

Solving your issue is like voodoo, even when there are "protocols" regarding how and which applications are supposed to open a specific kind of file. You'll see that they're very inconsistent between systems and different desktop environments.

So there's no really a "right" answer. I had a similar problem with firefox, so I'm giving you my solution:

  1. Create a ~/.local/share/applications/defaults.list if it doesn't exist
  2. Add the following

    [Default Applications]
    application/pdf=evince.desktop;
    

    ...or just the last line if there's something before.

Solution 3:

You can edit your $HOME/.local/share/applications/mimeapps.list file. If this file does not exist, create one.

For illustration's sake, if you want Chromium to be the default browser, add the following line:

x-scheme-handler/http=chromium.desktop

That's all.