Closed apyrgio closed 2 weeks ago
On almost all Linux distros, we can use xdg-mime
to find the default application for a mime type. On Tails, it returns the correct application:
$ xdg-mime query default application/pdf
org.gnome.Evince.desktop
We can improve this list by putting at the top the desktop file that xdg-mime
returns. If xdg-mime
is not present, or returns no results, we can keep the list order as is.
Dangerzone has some logic for detecting which application (
*.desktop
file) can open a PDF:https://github.com/freedomofpress/dangerzone/blob/65776d8c0506535c20f74f4375193287e1e8a78b/dangerzone/gui/logic.py#L97-L123
The result on Tails 6.2 is the following application list:
However, what's missing here is to present to the user the default application for opening PDFs. Instead, the first choice is picked up at random. Here, it's GIMP, whereas it should be Document Viewer.