How to change what external program calibre uses to open files¶
Here are two (mine) related questions:
Abbreviated solution is here:
QDesktopServices.openUrl(qurl) method, that uses
xdg-utils under the hood to open files.
xdg-utils is a stinking mess of fragile bash scripts, that ...
behaves erratically at best.
To set what program is used to launch a certain file you’ll need to:
- Find mimetype of this file, this can be done by:
xdg-mime query filetype <filename>
This will print out mimetype of that file, for example
Then you’ll need to find a
desktopfile associated with application you want to use. In debian desktop files are in
In case of pdf file I wanted to open it using
Associate desktop file with mimetype, using command:
xdg-mime default evince.desktop application/pdf.
Werify it works using
xdg-open. Now try to open this file using
xdg-open, if it opens in a proper application it should open in proper application in calibre.