AFAIK you can't use
file -i or
file --mime-type to test the functionality of the system-wide MIME database.
magic and its config by default, so to change the behavior of
file, you would have to change the
To check and modify the
xdg-open behavior instead, you should use the XDG-Utilities. For example, you can check the current settings how to handle files with
text/plain MIME type:
~ $ xdg-mime query default text/plain
On my Mint laptop, it returns
text/css, there's usually no default application set (you can check this using
xdg-mime query default text/css). To change this and set GEdit as default CSS editor, you could use the following command:
~ $ xdg-mime default gedit.desktop text/css
This will insert a line in
text/css=gedit.desktop. Instead of using xdg-mime, you could modify the
xdg-mime query returns the application i've chosen ...
~ $ xdg-mime query default text/css
xdg-open /tmp/file.css will start GEdit and load the CSS fiile.
See also this page on
xdg-open from the Arch Linux Wiki.