I know that there are some files /etc/gnome/defaults.list
that store mime associations and are in format that should make editing them possible.
But I am looking for a way that will handle at least one of following problems
- this file is in format that is reasonable to parse. Still, using API that somebody made and hopefully tested will save some time and problems with bugs
- it would be great to have API aware about location of that file depending on OS version, OS etc. Even crashing with "this is not supported" would be preferable to script editing something that is no longer used
I want to fully automate my installation of Ubuntu - setting file associations to correct one is intended to be part of that.
Even automated/semi-automated (like documentation) way to find place storing file associations would be welcome.
how can I change file association globally? mentions /usr/share/gnome/applications/defaults.list
, /usr/share/applications/defaults.list
and /usr/share/applications/mimeapps.list
See also Which default.list should I modify for default applications and what are the differences between the two? (so I would prefer to automate at least locating the file)