Alex Rivera | Logout

How to add new Mime Type and associate with new application?

Asked 2013-02-18T19:19:05.470
10

I have a new file type ".xy2" and I would like to associate it with a custom application "shim". Does anyone know how to do it in a Linux?

Thanks

Edit
Report

1 Answer

11

In case someone comes across the same problem. I found the answer:

  1. Create new Mime Type. You can specify a different mime-type, in this video the author is using text, but you can use application or image etc.. All available types are listed in "usr/share/mime" folder.
  2. Create your custom application and put a symlink into "usr/bin" folder.
  3. Navigate to "~.local/share/applicatons" folder and create new_mime_name.desktop file.
  4. Fill in information pertaining to your application. Here is an example of mine:

    [Desktop Entry]
    Terminal=false
    Icon=libreoffice-math
    Type=Application
    Categories=Application;Utility;
    Exec=shim %f
    MimeType=application/xy2;
    Name=shim
    Comment=shim tool
    
  5. Associate file types with your application. Read post from OM55 user.

  6. You might need to reboot your system.
answered 2013-02-18T20:05:47.633

Your Answer