De Kamiel

Offered by: ZirconfleX

http://www.zirconflex.be

"Open With" Troubles pdf

Summary

Using the Nautilus or Nemo file manager, you can double-click on a file to open it with its default application. If the default application is not what you like or you are not sure what the default application is, or want to modify it the default application, then you can right-click on the file. The first item on the fall down menu is the default application, and find a list of mime-type associations under the menu item "Open With". The last item on the list [Open Width] menu is [Other Application…]. Clicking on [Other Application…] brings up a dialogue box that lets one add another application than the default that can be used to open or run the file.
OpenWidth_1 Figure 1      OpenWith_2 Figure 2

Introduction

No problem was encountered adding new applications to the [Open Width] list of a file. The actions to add an application to open or run a file are: The issue is how to get applications removed from the [Open Width] list.
Searching the WWW I could find that an application could be removed from the [Open Width] list by: But that did not work at all for most of the applications.
I write for most because some applications could be removed from the above described way. So: why can some applications be removed and other not? That started my search to find out the why and what of the [Open Width] file option in Nautilus and/or Nemo. Keep reading on to find the how-to...

Unable to remove application

Why is it impossible to remove an application from the [Open with] menu using the GUI method, while other applications can be removed using this method (described above and showed in figure 4).
OpenWith_4 Figure 4
Well; To be able to remove an application from the [Open With] list it must be registered in mime-type files residing in specific directories of the system.

Mime-type

MIME stands for Multi-purpose Internet Mail Extensions. MIME types form a standard way of classifying file types on the Internet. Internet programs such as Web servers and browsers all have a list of MIME types. It turns out that Gnome based Linux distributions as Ubuntu and Linux-Mint use mime-type associations to know what type of application can run a certain type of file. This is reflected in the Nautilus and Nemo file browser default tool (double click) and right-click menu. The mime-type associations are stored in association list files and Nautilus or Nemo use these files to show file and application sets. Mimi-types are defined under the freedesktop system.
In Linux-Mint-19.3: Other places that possibly can hold mime-type files are:

Mime-type files

Mime-types

Mime types are predefined and determine the function of a file, so rather than, as Microsoft does, relying only on the file extension of a file name Linux uses a file’s MIME type that's embedded in the beginning of the file itself. Linux can easily open, with the correct application, a file without extension because it looks at the file’s MIME type to determine what type of file it is.

Manually add an association:

Associating applications to files is easy using the GUI as showed and explained before, but removing applications from the [Open With] menu or if one wants to add file associations manually the mime type of a file needs to be known. To do this:
Use: mimetype <filename> or in this case mimetype OpenWith_1.png
Example: