I'm trying to get
*.htm files to open in a different application than for
*.html (MIME Type
text/html), as generally described in GNOME Help > Add a custom MIME type for all users. I've created
<?xml version="1.0" encoding="UTF-8"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/x-html-notepad"> <sub-class-of type="text/html"/> <comment>HTML Notepad</comment> <glob pattern="*.htm"/> </mime-type> </mime-info>
and updated the desktop database as root (
update-mime-database /usr/share/mime). It still shows the built in HTML mime type for an HTML file with the
*.htm extension, as if the above definition had no effect (removing the
<sub-class-of> makes no difference):
$ gio info saved-web-page.htm | grep standard::content-type standard::content-type: text/html
Even when there's no HTML in the file it ignores the custom MIME type definition:
$ touch empty-file.htm $ gio info empty-file.htm | grep standard::content-type standard::content-type: text/plain
Please, what have I missed? I'm on GNOME 3.28.2 / Ubuntu 18.04.
EDIT: I've since phrased the question more fundamentally here on a different forum: MIME type text/html: how & where defined?