Setting a Default application

sidney

Member

Reaction score: 12
Messages: 54

I’ve installed both xpdf and mupdf. I want mupdf to be my default PDF viewer. However no matter what I do, xpdf keeps on launching for pdf files. How do I change this behaviour? TIA ....
 

gpw928

Aspiring Daemon

Reaction score: 241
Messages: 556

The answer you seek depends on what you are using to invoke the PDF viewer. You need to find out how it is configured to behave.

As Trihexagonal suggests, if your are running the xfe(1) file manager, then Edit->Preferences->Programs.

fluxbox(1) is window manager, not a file manager.

I'm not familiar with fluxbox(1), but xdg-mime(1) from devel/xdg-utils may be a good place to start, as it is designed to "integrate with the free desktop".

Lastly, just to obfuscate a little, the historical (probably now ancient) way of specifying the default application to invoke for any given file type (as identified by the "magic number", and as used by file(1)) was to use mailcap(4). Some of the more recent mechanisms will defer to metamail(1) if it's available.
 

Phishfry

Beastie's Twin

Reaction score: 2,668
Messages: 5,588

xdg has xdg-mime as an application.

# xdg-mime query default application/pdf
xpdf.desktop

So you might need to create the xpdf.desktop file and make sure xpdf is set as default with xdg-mime.
/usr/local/share/applications/xpdf.desktop
Code:
[Desktop Entry]
Name=xpdf
GenericName=PDF viewer
Comment=Display PDF files
Exec=xpdf %f
Icon=xpdf
Terminal=false
Type=Application
MimeType=application/pdf;
Categories=Viewer;Graphics;
Keywords=Viewer;Graphics;

 

dianamill

New Member


Messages: 1

I also had a problem. I just reinstalled the app. As a result, it turned out that it was all about a bad Internet connection. To be honest, many times, some application does not work as it should or does not load at all. I was so angry with my MacBook that I didn't think the problem could be completely different. I somehow accidentally thought of checking the Internet speed and downloaded it on the okaapps.com WiFi speed test. It turned out that my WiFi works very poorly, and the speed is very low. This made me very angry because I paid good money for the Internet.
 
Last edited:

scottro

Daemon

Reaction score: 902
Messages: 2,050

The OP wants mupdf to be the default though. Should they create a mupdf.desktop file imitating the xpdf.desktop one?
 

scottro

Daemon

Reaction score: 902
Messages: 2,050

Ok, I just tested. I actually have xpdf set as default for chromium and I didn't want that, I wanted zathura. First, to answer my own question, I changed $HOME/.config/mimeapps.list to use zathura.desktop instead of xpdf.desktop.
I then went to /usr/local/share/applcations and copied xpdf.desktop to zathura.desktop, substituting zathura for xpdf where it occurred in the file. I then went to open a pdf in chromium and it used zathura. To test for the OP, i also tried with mupdf and it works.

So, to sum up.
Edit your $HOME/.config/mimeapps.list so that the application for pdf says mupdf.desktop instead of xpdf.desktop. Go to /usr/local/share/appplications/ and copy the xpdf.desktop file to mupdf.desktop. In that new mupdf.desktop file, anywhere that you see xpdf, change it to mupdf. You shouldn't have to restart anything for it to work. I don't have icons--I use either dwm or openbox. If you use a desktop that uses icons, I don't know what you would edit to change the desktop icon, but hopefully, it's not overly complicated.
 

macondo

Active Member

Reaction score: 102
Messages: 200

You guys give me headaches, why no deinstall the one pdf viewer you don't want, this way the other one will be the default.
 

scottro

Daemon

Reaction score: 902
Messages: 2,050

It's a fair question. In my case, I prefer different pdf readers for different situations and I'm not overly worried about resources or disk space. As an example, I don't think you can print from mupdf, whereas you can from xpdf. Yet for general use I might prefer mupdf.
 
Top