I am currently not able to install and assoziate files to a new MIME-Type under CentOS (CentOS Linux release 7.4.1708 (Core)). I need the installation only for the current user, not for the whole system.
I am doing the following steps:
Creating a File-Type-Description XML "shinythings-shiny.xml"
<?xml version="1.0"?> <mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="text/x-shiny"> <comment>Shiny new file type</comment> <glob pattern="*.shiny"/> </mime-type> </mime-info>
Install
xdg-mime install shinythings-shiny.xml
Update Database
update-mime-database ~/.local/share/mime
Test
touch test.shiny xdg-mime query filetype test.shiny
But after all, the test still returns "text/plain". What i'm doing wrong?
The problem was the creation of an empty file via
touch
. After adding content to the file the mime-type was recognized.