You are not logged in.

#1 2014-09-10 18:54:39

bonob
Member
Registered: 2014-02-02
Posts: 23

[Solved] Midnight Commander file associations - ePub

After I installed Midnight Commander, it would open epub files with ebook-viewer (Calibre viewer) out of the box, without any specific config from me, which was great, since that was exactly what I wanted it to do.
Since right now, it no longer does that, and open the files with Firefox instead (which prompts me to save them somewhere.)

I did not install any update between yesterday and right now, so I wonder what could have happened. I actually restarted Firefox just before that because it froze, and the version 32 was recently shipped, so that might count as an update.


I have the default Midnight Commander settings, and from what I understand it's supposed to use lucidor to open epub files, which I don't have (that's in /usr/lib/mc/ext.d/doc.sh lines 177-178.)

So my question is, where this association, previously with Calibre, now with Firefox, comes from?
I understand that I could just edit ~/.config/mc/mc.ext to have the proper association, but if I could avoid changing the default settings, I would prefer so.

Last edited by bonob (2014-09-11 18:35:43)

Offline

#2 2014-09-11 11:47:48

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [Solved] Midnight Commander file associations - ePub

AFAIK, mc only reads its own associations. It does have alternate options depending on whether X is running or not. In any case, you should definitely modify the extension file to suit your needs. It's present in your $HOME, and a package update won't overwrite it.

Last edited by x33a (2014-09-11 11:48:09)

Offline

#3 2014-09-11 12:52:17

emeres
Member
Registered: 2013-10-08
Posts: 1,570

Re: [Solved] Midnight Commander file associations - ePub

 If I recall correctly mc does indirectly relay on xdg, so any changes to the standard application will be respected, ergo you can set xdg to use calibre viewer and mc should use it also.

Offline

#4 2014-09-11 18:34:57

bonob
Member
Registered: 2014-02-02
Posts: 23

Re: [Solved] Midnight Commander file associations - ePub

Thanks to your pointing at xdg, I understand what's happening. Poor Firefox or xdg associations are actually innocent, what happens is that after I close this particular book (which I just started to read before the problem happened) in Calibre, the mimetype changes, from application/epub+zip to application/zip (Calibre saves the file on exit, because it puts a bookmark at the current location.)

I don't know how to repair the mimetype, but I have a copy of the original file, so that's fine. I'll try to find more details and report to the Calibre developer, and mark this thread solved.
Thanks again!

Offline

#5 2014-09-14 17:53:14

bonob
Member
Registered: 2014-02-02
Posts: 23

Re: [Solved] Midnight Commander file associations - ePub

In order to not confuse anyone who might stumble over the same issue, here is the correct explanation: this was because I didn't install the proper package for mime type identification.

As the wiki on xdg-open explains, when running without a desktop environment, one should install perl-file-mimeinfo in order to provide correct mime types. Otherwise xdg-open falls back on 'file -i', which isn't too great with mime types.

Offline

Board footer

Powered by FluxBB