1

I am using Linux Mint Tara (xfce). I would like to use mupdf-gl as a default application for viewing pdf files and automatically set 150 dpi as the resolution, i.e. when I double click a pdf file, it should be opened in mupdf-gl with the resolution set to 150 dpi. Currently it opens in mupdf-gl with the default resolution of 72 dpi. The resolution can be set on the command line as follows: mupdf-gl -r 150 FileToOpen.pdf but I don't know how to set it for files which are to be opened using the mouse.

Note that since mupdf-gl is not available in the repositories, I have downloaded the source files from mupdf.com and built it on my machine.

4
  • how did you tell xfce (or whatever) to associated PDFs with mupdf?
    – thrig
    Commented Jan 30, 2019 at 18:29
  • I right clicked on a pdf file in the file manager (thunar) -> open with another application -> use a custom command (in this case /usr/bin/mupdf-gl) and checked the box "use as default for this kind of file" Commented Jan 30, 2019 at 18:54
  • @SalilS.Kulkarni you can edit the custom command given in thunar to include the -r 150 option itself and then check the box. Commented Jan 31, 2019 at 11:54
  • @PrathuBaronia Thanks for point it out. It works Commented Jan 31, 2019 at 17:53

2 Answers 2

1

It sounds like you can simply make a little wrapper script that applies your desired arguments:

#!/bin/sh
exec /usr/bin/mupdf-gl -r 150 "$@"

and then save this code somewhere on the system (say to /usr/bin/my-mupdf), make it executable (chmod +x /usr/bin/my-mupdf), and then select the path to this wrapper script from the GUI (/usr/bin/my-mupdf instead of /usr/bin/mupdf-gl). This way the GUI calls your wrapper script which in turn replaces itself with mupdf-gl with the appropriate arguments.

0

Just create an alias for mupdf-gl, like this:-

$ alias mupdf-gl=mupdf-gl\ -r\ 150

Be sure to include this line in your /home/.bash_aliases to avoid typing it again.

2
  • Does this alias also applies to files which will be opened by double clicking in the file manager or will be useful only for opening the files using the command lines Commented Jan 30, 2019 at 18:22
  • I checked, this does not work for mouse clicked files. Let me find a solution and update my answer. Commented Jan 31, 2019 at 9:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .