I am trying to create file associations so I can double click a file and it will open with my program - and will associate an icon with that file type.
I created the file myapp-xxx.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info">
<mime-type type="application/myapp-xxx">
<comment>My app dummy mime</comment>
<sub-class-of type="application/octet-stream"/>
<glob pattern="*.xxx"/>
<generic-icon name="MyApp"/>
</mime-type>
</mime-info>
I placed MyApp.png
in /usr/share/icons/
I placed myapp-xxx.xml
in /usr/share/mime/application/
I ran
sudo update-mime-database /usr/share/mime
and my xml promptly disappeared.
I read that it can be because i am missing description... but looking at all the examples, and the existing mimes, I don't see what I am missing.
12.04
Note: I have a .desktop file too... but since the mime database removes the mime, I don't think having the reference in the .desktop file will help.