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?
To answer my own question, these applications use
xdg-openinstead ofrun-mailcap.And indeed the following command runs Okular instead of LibreOffice:
I can verify the assigned MIME type with:
Then, I can check which application is assigned to that MIME type:
This explains the issue. When I uninstall Okular, it leads to the correct response:
So there's something wrong in either the Okular or the LibreOffice package.