xdg-mime install does not update files mime-type association

985 views Asked by At

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:

  1. 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>
    
  2. Install

    xdg-mime install shinythings-shiny.xml
    
  3. Update Database

    update-mime-database ~/.local/share/mime
    
  4. Test

    touch test.shiny
    xdg-mime query filetype test.shiny
    

But after all, the test still returns "text/plain". What i'm doing wrong?

1

There are 1 answers

0
user3169920 On

The problem was the creation of an empty file via touch. After adding content to the file the mime-type was recognized.