To set file associations, there are 2 configurations you should care about:
- mime-type definition
- application association
To set mime-type definition, open
/usr/share/mime/packages, and view the .xml files in it. You’ll
find how to write your own mime-type definitions.
To set application associations, open
/usr/share/applications, and view the .desktop files in it.
You’ll find how to write your own .desktop files. Also, don’t forget to view the defaults.list
file, which sets the default applications for certain mime-types.
There are also local settings, located at
~/.local/share/applications. Local settings will take precedence over global, i.e., system
settings, by convention.
Finally, there is an example:
Note. There are also tools to manage these tasks, such as