14

I recently installed Skype on Kubuntu 20.04 via snap and I discovered that it added itself at the end of the list of applications associated with every single file type on the system! Of course, this means that for the many file types recognised by the system that don't currently have an application associated with them or unknown file types, Skype became the default application.

The only practical way I found of undoing this (practical meaning not manually going through every single file type) was to completely uninstall Skype.

Is there a way of preventing an application from doing this? Or at least, is there a simple way of undoing this after the fact?

This example is specific to Skype on snap, but I'd prefer a general answer (i.e., that would apply to any app on snap or in general) if it exists. The only answers I've seen related to similar issues with file-type associations are application-specific, so not helpful in this case.

System:

  • Operating System: Kubuntu 20.04
  • KDE Plasma Version: 5.18.8
  • KDE Frameworks Version: 5.68.0
  • Qt Version: 5.12.8
  • Kernel Version: 5.15.0-46-generic
Ratler
  • 578

1 Answers1

13

I made the same experience and looked for a solution a while ago, so here is what I did and it works pretty well so far. The snap needs to be installed to do this.

First copy the corresponding .desktop-file to your home directory with

cp /var/lib/snapd/desktop/applications/skype_skypeforlinux-share.desktop ~/.local/share/applications/

Now edit ~/.local/share/applications/skype_skypeforlinux-share.desktop and remove the line

MimeType=application/octet-stream;

from the file and save it. As a last step make sure, that the .desktop-file has execute permissions:

chmod +x ~/.local/share/applications/skype_skypeforlinux-share.desktop

Done!

Of course, instead of using terminal commands, you can do the whole thing using your file manager.

Some side notes:

The MimeType-line in .desktop-files tells the system which mime types are supported by an application. This information is used to populate the open-with-lists.

The mime type application/octet-stream seems to be a bit special, since you can open any file as an application/octet-stream. I think that's the reason why the application is added to the open-with-list for any type of file.

.desktop-files with the same name in ~/.local/share/applications take precedence over .desktop-files in the system-wide locations like /usr/share/applications (for deb-packages) and /var/lib/snapd/desktop/applications (for snaps).

A .desktop-file in ~/.local/share/applications will not get overridden by reinstalling or upgrading an application.

If you want to dive deeper into the topic, I'd recommend to take a look at the freedesktop.org/specifications. This whole thing is widely used under Linux, especially under KDE, Gnome and xfce.

mook765
  • 18,644