Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 01-13-2025, 09:23 AM   #1
oddhack
Junior Member
oddhack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2025
Device: none
How does calibre determine viewer to invoke on Debian?

When I asked calibre running on Debian 12 to view a book in PDF form, it launches ebook-viewer instead of the PDF viewer configured in mime.types / mailcap. I am guessing this is because it's doing something involving XDG, since

xdg-mime query default application/pdf

returns

calibre-ebook-viewer.desktop

(and ebook-viewer is definitely not a PDF viewer). It is not clear to me where it's getting this association from, as I'm not even running an XDG-compliant WM (WindowMaker) and don't have any of the XDG environment variables set.

I'm drowning in XDG documentation at the moment trying to figure out what's going on, and it would be easier if someone in the forums happens to know what calibre is actually doing to determine this association (and even easier if there's some way to override the behavior globally in calibre, instead of right-clicking on the PDF and selecting a different application every time).

Failing that all I can think of is using xdg-settings to alter this, then look at the filesystem to see what files got updated as a result of doing that.
oddhack is offline   Reply With Quote
Old 01-13-2025, 10:05 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,311
Karma: 27111242
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibre doesnt determine it, Qt determines it and it used to use xdg-open, though I havent looked at its source code recently. My long standing recommendation on Linux is to just write your own xdg-open script, put it somewhere in PATH ahead of the system one, and free yourself from all that useless XDG baggage forever.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-13-2025, 09:05 PM   #3
oddhack
Junior Member
oddhack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2025
Device: none
Quote:
Originally Posted by kovidgoyal View Post
calibre doesnt determine it, Qt determines it and it used to use xdg-open, though I havent looked at its source code recently. My long standing recommendation on Linux is to just write your own xdg-open script, put it somewhere in PATH ahead of the system one, and free yourself from all that useless XDG baggage forever.
Thanks! That's all I needed to move forward.
oddhack is offline   Reply With Quote
Old 01-14-2025, 03:28 AM   #4
oddhack
Junior Member
oddhack began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Jan 2025
Device: none
Eventually sorted out that

$ xdg-mime default org.gnome.Evince.desktop application/pdf

fixes the problem, per https://wiki.archlinux.org/title/GNO...ocument_viewer . This appears to modify only $HOME/.config/mimeapps.list in my setup. And now calibre is opening PDFs in evince once again. A bit annoying that I will never know what random package I installed may have decided to replace this association, without asking.
oddhack is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian on modern kindles with pre-built qemu and debian image, scripts, desktop theol0403 Kindle Developer's Corner 27 05-15-2021 03:57 PM
How can i determine what books have DRM in calibre jchiar Calibre 5 12-20-2015 09:14 AM
Determine which format was a Calibre conversion? badbob001 Library Management 5 03-20-2015 02:52 PM
How does Calibre determine when a library book is on a device? SampleAndy Library Management 3 02-24-2013 11:20 PM
Calibre not starting on debian saturnblackhole Calibre 3 12-11-2011 12:05 AM


All times are GMT -4. The time now is 09:38 PM.


MobileRead.com is a privately owned, operated and funded community.