AppImage – How to Associate a File Type with an AppImage

appimagedefault-programsdesktopkrita

I'm using ubuntu 16.04 LTS.

I've downloaded the latest krita appimage
(http://files.kde.org/krita/3/linux/krita-3.0-x86_64.appimage)

I want to be able to open Krita files (with the extension ".kra", mime-type "application/x-krita") with this appimage, by double-clicking the file icon.

How do I do this?

I have tried moving the appimage to /usr/share/applications, I've tried adding a desktop file /usr/share/applications/krita.desktop with the following contents:

[Desktop Entry]
Name=Krita
Exec=/usr/share/applications/krita-3.0-x86_64.appimage %F
Type=Application
MimeType=application/x-krita

I've made sure both files have the same permissions as other files in the same directory.

Krita does not appear under "Open With Other Application…"

Best Answer

Got this working on Mint 18.1 Cinnamon.

The .appimage of Krita 3.1.2 didn't add any file associations, so I created a file named krita.desktop, and put the following inside:

[Desktop Entry]
Encoding=UTF-8
Name=Krita
Comment=Krita, An open source painting and drawing application.
Exec=[path to .appimage] %F
Type=Application
Icon=[path to icon]
Categories=Graphics; 
MimeType=image/krita;

I made that file executable, then copied it to /usr/share/applications.

Next I opened ~/.config/mimeapps.list, and appended:

image/krita=krita.desktop;

under the section [Added Associations]

Finally I right clicked a .kra file and chose Krita as the default app under Open With.

Hope that helps someone out.

Related Question