Hi
I’ve installed Calibre to manage my book collection. I’ve used the flatpak version, however, this should not be calibre-specific.
Since installing, calibre wants to open all kinds of documents. While this may be cool for some, I’ll end up with *.service
, *.txt
, *.md
, *.odt
, and *.pdf
files in my database which I definitely don’t want there.
To be specific, I don’t want calibre to be associated with any mimetype. If I want to add a new book, I’ll just open Calibre and add it.
There are other programs which at random (?) points in time just define them as default programs (e.g. the Brave browser is suddenly the default image viewer).
I’m using i3.
Can I ignore a program from every being the default for anything?
You might have some luck using xdg-mime
to specify default associations. There is an Arch Wiki page that might be helpful:
Though I haven’t played with i3 in a long time, I’m guessing that xdg-mime
should already be installed.
Regards.
Thanks. You’re correct and I can set default a default application for specific mimetypes with xdg-mime. What I want is the opposite, add applications to a blocklist to make sure they are never set as default.
There are also too many mimetypes to make an exhaustive list with their default program.
In the mimeapps.list file, I can add [Remove Associatios]
but also this list must be exhaustive, meaning I have to list all hundreds of different text file and document types.
There surely must be a more clever way.
It’s easy enough in Plasma (using the File Associations dialog), but frankly, I didn’t play with i3 long enough to experiment with its idiosyncrasies.
I’ll chime in again if I find anything less tedious.
Regards.
Whether it’s a particularly bright idea to edit a mime list directly, I can’t say; however, there is ~/.config/mimeapps.list
with three sections, namely;
[Added Associations]
[Default Associations]
[Removed Associations]
which might be leveraged to add/remove certain mime types manually; I don’t know if the file exists in i3 or if it could be a practical workaround.
1 Like
This will likely be different for a Flatpak, but for a repo version have you tried creating a custom .desktop
file for Calibre in ~/.local/share/applications
with all of the MimeType stuff removed?
1 Like
Calibre from extra repository has 4 desktop launchers:
$ grep MimeType /usr/share/applications/calibre*
/usr/share/applications/calibre-ebook-edit.desktop:MimeType=application/epub+zip;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/x-mobi8-ebook;application/xhtml+xml;text/html;
/usr/share/applications/calibre-ebook-viewer.desktop:MimeType=application/epub+zip;application/ereader;application/oebps-package+xml;application/vnd.ctc-posml;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/x-cb7;application/x-cbc;application/x-cbr;application/x-cbz;application/x-mobi8-ebook;application/x-mobipocket-ebook;application/x-mobipocket-subscription;application/x-sony-bbeb;image/vnd.djvu;
/usr/share/applications/calibre-gui.desktop:MimeType=application/epub+zip;application/ereader;application/oebps-package+xml;application/vnd.ctc-posml;application/vnd.ms-word.document.macroenabled.12;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/x-cb7;application/x-cbc;application/x-cbr;application/x-cbz;application/x-mobi8-ebook;application/x-mobipocket-ebook;application/x-mobipocket-subscription;application/x-sony-bbeb;image/vnd.djvu;x-scheme-handler/calibre;
/usr/share/applications/calibre-lrfviewer.desktop:MimeType=application/x-sony-bbeb;