24

When I install shutter to take screenshots, imagemagick sets itself as default PDF-reader and I am unable to change it.

I would like to have evince as default PDF-reader.

I have tried right click on a PDF document in file explorer-> Properties -> Set default application-> Evince.

This does not work, imagemagick stays as default. Doing this with the file explorer opened as root works but it doesn't change the normal-user default application.

Using xdg-mime does not help either. In /etc/gnome/defaults.list the default application for PDF is evince.

And, when I remove imagemagick-6.q16, evince becomes the default application for opening PDFs, but shutter is removed too.

Am I missing something ? Where can I change this behavior ?

I have an updated version of Debian Jessie in my computer and I am using Gnome3.

EDIT 1:

I can replicate this behavior with different file explorers (tested with nemo and nautilus)

The output of XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/x-pdf is

Checking /home/USER/.local/share//applications/mimeapps.list
Checking /usr/share/gnome/applications/defaults.list
Checking /usr/local/share//applications/defaults.list
Checking /usr/share//applications/defaults.list

I've checked this files:

  • In /home/USER/.local/share//applications/mimeapps.list I have a line with application/pdf=evince.desktop
  • In /usr/share/gnome/applications/defaults.list the PDF reader is set to evince too.
  • In /usr/local/share/applications/defaults.list there is no reference to PDFs.
  • /usr/share/applications/defaults.list does not exist
Gypaets
  • 407
  • 1
  • 4
  • 11
  • 1
    Which file explorer are you talking about? Linux has dozens. What does `XDG_UTILS_DEBUG_LEVEL=2 xdg-mime query default application/x-pdf` output? – Gilles 'SO- stop being evil' Sep 01 '15 at 22:46
  • I've answered your question in the EDIT 1. – Gypaets Sep 02 '15 at 05:56
  • Hmmm. I don't understand how Gnome applications determine what application to use to open a file. If you run `xdg-open somefile.pdf` on the command line, what application runs? What if you use `see somefile.pdf`? Does running the following command help? `grep 'pdf.*evince' /etc/mailcap >>~/.mailcap` – Gilles 'SO- stop being evil' Sep 02 '15 at 08:42
  • `xdg-open` uses imagemagick, with `see` the `file.pdf` is opened with `evince-previewer`. Creating `.mailcap` doesn't help. – Gypaets Sep 02 '15 at 09:04

3 Answers3

15

Edit file: ~/.config/mimeapps.list and set pdf to evince.desktop. It works for me.

Source: https://askubuntu.com/questions/591425/why-do-pdf-documents-open-with-imagemagick

Benjamin Loison
  • 180
  • 1
  • 5
Jerolata
  • 166
  • 1
  • 3
  • Thanks, i had already set long ago 'application/pdf=evince.desktop;' but some lines further was 'image/pdf=...;', which had to be set to 'evince.desktop' too. – Gypaets Nov 01 '15 at 09:34
  • This works for **Debian/Ubuntu** - based Pop! with **GNOME** using **Nautilus**. – Erdinc Ay Apr 21 '22 at 10:14
8
  • rightclick on file
  • "Properties"
  • "Open with"
  • select your favourite Application
  • "Set as default"

enter image description here

Source: https://fedoramagazine.org/how-to-select-and-set-default-applications-in-fedora/

JoKalliauer
  • 477
  • 1
  • 5
  • 16
7

You can check the file defaults.list and change it to evince if necessary. On my system:

$ cat /usr/share/applications/defaults.list  | grep pdf
application/pdf=evince.desktop;atril.desktop
user1717828
  • 3,512
  • 6
  • 23
  • 32
  • 10
    In a Debian system you are not supposed to change files under `/usr`. Your changes will be overwritten during package upgrades! – Jay Sep 26 '17 at 07:14