On Mon, 31 Jan 2022 at 18:36:11 -0500, Eric Cooper wrote: > I have both mupdf and calibre installed. When I choose File > Print, > and then Print Preview, gimp launches the ebook-viewer program from > calibre rather than mupdf, which appears before ebook-viewer in > /etc/mailcap (if that matters).
The command used for print previews in GTK 2 comes from your GTK theme (for historical reasons) or from gtkrc (several locations are searched, ~/.gtkrc-2.0 is the highest-priority). Neither ebook-viewer nor mupdf is hard-coded anywhere in GTK or GIMP. The only hard-coded command related to print previews is GNOME's evince, which is used as a default if nothing else is configured. Rather than /etc/mailcap, it is more likely that the print preview is using your configured default PDF viewer according to this freedesktop.org specification: https://specifications.freedesktop.org/mime-apps-spec/latest/ You can configure the preferred PDF viewer for each user via ~/.config/mimeapps.list, or system-wide via /etc/xdg/mimeapps.list. In a well-integrated desktop environment, defaults for several commonly-used applications are in /usr/share/applications/DESKTOP-mimeapps.list, where DESKTOP is the value of $XDG_CURRENT_DESKTOP transformed to lower-case. For example, the GNOME desktop environment uses XDG_CURRENT_DESKTOP=GNOME, and installs /usr/share/applications/gnome-mimeapps.list via the gnome-session-common package. /etc/mailcap is no longer used by most libraries and applications. It's generated from freedesktop.org .desktop files by the update-mime command for compatibility with libraries and applications that still use it, but for historical reasons it has its own preference order. smcv

