Mimetype for chm files

Mike Massonnet | Posted 1 month, 4 days ago on April 17, 2006

Hydiho,

I installed xCHM and guess what, I had no correct mimetypes defined for *.chm files! However a desktop file for xCHM is present, but not valid. *cough*

I corrected it like that:

[Desktop Entry]
Encoding=UTF-8
Name=xCHM
Comment=Compiled HTML Help (CHM) file viewer
Exec=xchm
Terminal=false
Type=Application
MimeType=application/x-chm;
Icon=xchm-48.xpm
Categories=Application;Viewer;Graphics;

The desktop Entry Specification are on standards.freedesktop.org/desktop-entry-spec/latest/.

Next I executed update-desktop-database to refresh the cache file. I can check it with:

$ grep xchm /usr/share/applications/mimeinfo.cache
application/x-chm=xchm.desktop

And now for the file icons. I am using the Tango theme which doesn't provide a mimetype for x-chm. So I did same as for the PDF mimetype, I created links to x-office-document like this way:

cd .icons/Tango
ln -s 16x16/mimetypes/x-office-document.png \
  16x16/mimetypes/gnome-mime-application-x-chm.png
ln -s 22x22/mimetypes/x-office-document.png \
  22x22/mimetypes/gnome-mime-application-x-chm.png
ln -s 24x24/mimetypes/x-office-document.png \
  24x24/mimetypes/gnome-mime-application-x-chm.png
ln -s scalable/mimetypes/x-office-document.svg \
  scalable/mimetypes/gnome-mime-application-x-chm.svg

And now I have wonderful icons for *.chm files instead of the unknown :)
chm_icon

Earlier posts