4 ms·
OP is missing definitions that associate *.docx files, etc., with the appropriate MIME type. The Garbage In, Garbage Out principal applies here. For anyone in
by yrro 6y ago
OP is missing definitions that associate *.docx files, etc., with the appropriate MIME type.
The Garbage In, Garbage Out principal applies here.
For anyone interested about how the plumbing, here are the specs:
shared-mime-info-spec[0] is for mapping glob patterns, magic numbers, string fragments, etc. to MIME types; and desktop-entry-spec[1] is for defining what an application is, its icon, how to launch it, what MIME types it handles, etc.
[0] https://freedesktop.org/wiki/Specifications/shared-mime-info-spec/ https://freedesktop.org/wiki/Specifications/shared-mime-info...
[1] https://www.freedesktop.org/wiki/Specifications/desktop-entry-spec/ https://www.freedesktop.org/wiki/Specifications/desktop-entr...
On my (Debian) system, the following packages provide the definitions that map *.docx files to the appropriate MIME type:
$ grep -l '\*.docx' /usr/share/mime/packages/*.xml | xargs dpkg -S
shared-mime-info: /usr/share/mime/packages/freedesktop.org.xml
libreoffice-common: /usr/share/mime/packages/libreoffice.xml
... and subsequently:
$ xdg-mime query filetype Downloads/something.docx
application/vnd.openxmlformats-officedocument.wordprocessingml.document
$ xdg-mime query default application/vnd.openxmlformats-officedocument.wordprocessingml.document
libreoffice-writer.desktop*