i'm on Xubuntu and i use Thunar File Manager. I want to create some new Mime Types and associated Icons. Sometimes it works, sometime not and sometimes there are unintended results (the same icon for files that have nothing to do with the mime type i've created the icon for).

Sometimes I could create a new Mime Type by adding a new xml file in /usr/share/mime/application as discripted here https://help.ubuntu.com/community/AddingMimeTypes. It never works when i do this in ~/.local/share/mime/application. Here the file is deleted after i update the mime-database, also when i create the xml file in an other sub folder. What is the correct folde rand the correct way to create a new file type? Maybe the problem is that this mime types already exists and this existing mime type isn't displayed in the mime type editor?

Sometimes i have different results when i check the mime type with

xdg-mime query filetype *.mp3


file --mime-type *.mp3

(mp3 is just an example). Why are there sometimes different mime types?

Sometimes i could create a new icon for an existing or previously created mime type be creating a new xml file in ~/.local/share/mime/packages with this content

Flac Flac

Different to the mime type this works in the home dir. But its doesn't work for all icons i've created and i can't find out why thats so. It seems 'update-mime-database' creates a new xml file in ~/.local/share/mime/application when i create the xml file here in packages subfolder?

Possibly there is something completely wrong what i'm doing there? What is the correct Way to create a new mime type AND a new icon for that mime type and how can i check whether the mime types already exists?

  • Correct way I cannot say but have you tried unix.stackexchange.com/a/501060/323121 ?
    – Rusi
    Mar 7, 2019 at 11:56
  • Thats no really what i want. That works for Thunar and perhaps other file managers, but here is have the same problems. if a specific miem type doesn't exist there are the mentoined problems.
    – fmeier
    Mar 7, 2019 at 12:55


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.