Ubuntu – How are file-extensions/mime-types/icons/default applications associated

file formatmime-type

Is there a way / application to add a file extension / mime-type to the system. What I want to achieve is:

  • Have a default program for opening files of this type
  • Have a special icon for this filetype
  • let file output the type of a file of this file in a more specific way.

Is there an way to achieve this?

Best Answer

You need to:

  1. Add a new MIME type
  2. Associate that MIME type with a program (see man xdg-mime for more details):

    xdg-mime default APPLICATION MIMETYPE(S)