MuPDF is not included in Main Menu and Rofi

I’m trying a new pdf viewer (mupdf) and, funny enough, can’t find it anywhere.

There are no errors during the installation and the mupdf.desktop files can be found in the usual /usr/share/applications and ~/.local/share/applications.

I tried checking the *.desktop syntax with desktop-file-validate (all good) but I’m running out of ideas. Don’t know what is special about this app but normally as soon as you install any other it reflects right away when you invoke D-run or navigate the Main Menu.

Even funnier is that pcmanfm has it in the contextual menu.

Looking at the .desktop file provided by MuPDF, it seems that everything works as intended by the developers. This file only adds an action to the context menu for supported file types.
And MuPDF cannot be started without specifying a file to open.

napcok@mabox ~ $ mupdf
usage: mupdf [options] file.pdf [page]
	-p -	password
	-r -	resolution
	-A -	set anti-aliasing quality in bits (0=off, 8=best)
	-C -	RRGGBB (tint color in hexadecimal syntax)
	-W -	page width for EPUB layout
	-H -	page height for EPUB layout
	-I -	invert colors
	-S -	font size for EPUB layout
	-U -	user style sheet for EPUB layout
	-X	disable document styles for EPUB layout

Desktop file:

[Desktop Entry]
Name=MuPDF
GenericName=PDF file viewer
Exec=mupdf %f
TryExec=mupdf
Icon=mupdf
Terminal=false
Type=Application
MimeType=application/epub+zip;application/pdf;application/x-pdf;application/x-cbz;application/oxps;application/vnd.ms-xpsdocument;image/jpeg;image/pjpeg;image/png;image/tiff;image/x-tiff
Categories=Viewer;Graphics;
Actions=View
NoDisplay=true
[Desktop Action View]
Name=View with mupdf
Exec=mupdf %f

NoDisplay=true means: do not show in menu.

1 Like

Thank you @napcok, that’s reasonable.

If anyone get stumped with an application like this one, the solution is right click any target file on pcmanfm → Open with → Open with… (bottom) and then the second tab (Custom Command Line), there, write the application name followed by %f and the name. Don’t forget to check the mark, that will make permanent the file association.

1 Like