3

Within Alpine, if I hit enter on a PDF attachment, my system brings up Okular. I would prefer if it brought up Evince, because that's the PDF viewer I normally use. How can I do that? This is clearly a MIME issue, but I'm not sure how to (re)-configure things to make this work.

/etc/mailcap is probably relevant. it has bucketloads of stuff in it, and mentions both Okular and Evince in the context of PDF without obviously preferring one over the other.

UPDATE: Actually, this answer to an earlier question of mine might do the trick as well. Need to check.

UPDATE 2: I ran

xdg-mime default evince.desktop application/pdf

and now I see an entry in ~/.local/share/applications/mimeapps.list

application/pdf=evince.desktop

under both the sections "[Added Associations]" and "[Default Applications]", but Alpine is still using Okular. (I also restarted Alpine.) What am I missing?

Michael Mrozek
  • 91,316
  • 38
  • 238
  • 232
Faheem Mitha
  • 34,649
  • 32
  • 119
  • 183
  • You can investigate by running Alpine under `strace`, which should tell you what configuration files it reads. It may invoke some other program to do the job; use `strace -f` to get a trace for subprocesses as well. – Gilles 'SO- stop being evil' Oct 30 '14 at 23:15
  • Alpine usually uses the default pdf viewer of the system. So if Evince is the default, it is a good idea to uninstall then reinstall Alpine. Hope this helps. – Name Nov 01 '14 at 10:08

2 Answers2

3

Sounds like it's ignoring the per-user settings. You can change the systemwide setting by editing /etc/mailcap.order, the syntax is fairly simple:

first-choice-app-name:mime-type
second-choice-app-name:mime-type
...

So you'd probably put:

evince-previewer:application/pdf
evince:application/pdf

(evince-previewer is fairly new, may not exist in Wheezy, but having it there is harmless).

Then you run /usr/sbin/update-mime to update /etc/mailcap.

Faheem Mitha
  • 34,649
  • 32
  • 119
  • 183
derobert
  • 107,579
  • 20
  • 231
  • 279
2

Alpine reads per-user "mailcap" settings from ~/.mailcap, which overrides the systemwide /etc/mailcap. So just put the following line in ~/.mailcap:

application/pdf; evince %s
L. Levrel
  • 1,453
  • 8
  • 23