user preferred application for a mimetype

David Faure faure at
Sun Dec 1 15:07:53 PST 2013

On Sunday 08 September 2013 12:37:33 Luc Menut wrote:
> Hi all,
> I try to understand how should be defined the preferred application for
> a given mimetype according to freedesktop specifications.
> I read
> Is it still the reference document for this?

I think so.

> 1) mimeapps.list and [Default Applications]
> Since some versions, glib/gio uses a new section [Default Applications]
> in user ~/.local/share/applications/mimeapps.list.
> This section is not defined in the freedesktop mime-actions-spec; in
> this document, IIUC, the preferred application for a given mimetype
> should be the first application from [Added Associations] for this mimetype.
> Is this section [Default Applications] defined somewhere in a
> freedesktop specification or is it gnome specific?

It's glib/gio specific.

KDE picks the default application, if not mentionned in [Added Associations], 
as being the one where the .desktop file has the higher InitialPreference 
value. In other words, different desktops have different code for this. But as 
pointed out previously, this isn't necessarily a bad thing, since anyway 
different desktops -should- have different defaults, for many things
(e.g. different default browser, mail client, text editor, etc. for better 
integration with the desktop)
It's just understandably annoying for ISVs who want to set up their app as 
default, because "it's for sure better than any that the desktops might 
provide" :-)

> 2) preferences order
> For a given mimetype, the order of applications and the preferred
> application can be defined in:
> A - global mimeapps.list [Added Associations]
> (/usr/share/applications/mimeapps.list),

(or whereever $XDG_DATA_DIRS points to, yes)

> B - global defaults.list [Default Applications]
> (/usr/share/applications/defaults.list),

Don't ask me - glib/gio specific :)

> C - user mimeapps.list [Added Associations]
> (~/.local/share/applications/mimeapps.list),

(or whereever $XDG_DATA_HOME points to, yes)

> D - user mimeapps.list [Default Applications],
> E - user defaults.list [Default Applications]
> (~/.local/share/applications/defaults.list): is it still valid? or now
> deprecated?

Don't ask me - glib/gio specific :)

> Which order should be used to defined the user preferred application
> according to freedesktop specifications?

C > A > implementation-dependent default ;-)

David Faure, faure at,
Working on KDE, in particular KDE Frameworks 5

More information about the xdg mailing list