3

It seems that Thunar and Midnight Commander (any maybe other tools) don't use Mailcap to decide how to open a file. What do they use instead?

Background of the question: On my system, Thunar and Midnight Commander open all ODT files with Okular instead of LibreOffice.

I tried to debug this by checking ~/.mailcap and /etc/mailcap, which do contain Okular rules for ODT, but the LibreOffice (soffice) rules clearly take precedence.

I verified this by running mailcap directly on an ODT file:

run-mailcap --norun /tmp/example.odt

The output is exactly what I expect:

soffice --nologo --writer '/tmp/example.odt'

Also, if I run that command, LibreOffice is indeed started and opens the file.

So to my understanding, MC and Thunar should open ODT files with LibreOffice. But they use Okular. Why?

vog
  • 23,517
  • 11
  • 59
  • 75

1 Answers1

2

To answer my own question, these applications use xdg-open instead of run-mailcap.

And indeed the following command runs Okular instead of LibreOffice:

Command:

xdg-open /tmp/example.odt

I can verify the assigned MIME type with:

Command:

xdg-mime query filetype /tmp/example.odt

Output:

application/vnd.oasis.opendocument.text

Then, I can check which application is assigned to that MIME type:

Command:

xdg-mime query default application/vnd.oasis.opendocument.text

Output:

 kde4-okularApplication_ooo.desktop

This explains the issue. When I uninstall Okular, it leads to the correct response:

Output:

 libreoffice-writer.desktop

So there's something wrong in either the Okular or the LibreOffice package.

vog
  • 23,517
  • 11
  • 59
  • 75