Proposal for an intent-apps spec

David Faure faure at kde.org
Thu May 6 08:35:56 UTC 2021


On lundi 3 mai 2021 12:33:46 CEST Thomas Kluyver wrote:
> There was a discussion recently about how a default application for a
> mime-type was chosen when no mimeapps.lst specified a preference - some
> launchers were giving semi-random results that changed unexpectedly.
> 
> As you said, the new spec closely follows mime-apps. I think it would be a
> good idea to head off similar issues in the future by giving a bit more
> detail in the recommendation for what to do when no preference is found.
> This is the relevant bullet point at present:
> 
> "if after all files are handled, we have not yet found a default
> application, select the most-preferred application (according to
> associations) that supports the intent"
> 
> But what makes an application most-preferred, apart from this spec? AFAIK,
> there is no other way to decide this in general. 

You're right, this sentence (taken from mime-apps-spec) doesn't make sense.

> Of course, a launcher may
> have a hardcoded default for specific interfaces it recognises - e.g. KDE
> might pick Konsole for org.freedesktop.Terminal1 - but it should be
> prepared to handle interfaces it doesn't know.

Not sure what you mean. The only (DBus) interface that we expect to use for 
this is org.freedesktop.Terminal1. Maybe you meant "implementation" rather 
than "interface"? In that case I agree, see below.

> I can see two possible recommendations that make sense:
> 
> - Pick the default in a simple, consistent manner (e.g. first desktop file
> sorted by name), and make it obvious how the user should set their
> preference if they don't like it.
> - Pick an arbitrary default, and then
> write it as the preference in XDG_CONFIG_HOME, so the same application will
> be used until the user picks another one (or uninstalls that one).

Or Eli's suggestion of a GUI to ask the user.

In my opinion, all three possibilities make sense, but should only be 
recommendations for an implementation specific behaviour. We don't need to 
actually specify this part.
E.g. I can understand if the gnome implementation doesn't go for "sort by 
name" since that would select konsole over gnome-terminal for every new user 
;)
So it seems much more likely that the implementation specific fallback would 
be something like "use the implementation from the same desktop environment / 
software stack, if available, and only then, fallback to sorting by name, or 
picking and saving, or asking the user."

> It might also be worth saying that the spec doesn't rule out using
> Implements= for cases where there's no default application - where you're
> interested in all the applications implementing an interface, rather than
> just one. I don't think anything in the new spec is a problem for that, but
> it might be good to make that explicit.

Sure, that's exactly what I intend to do in the KDE GUI configuration module
to let the user choose which terminal to use.

I have updated 
https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/45
based on your feedback above.

> Other than that, I think it looks like a nice addition. :-)

Thanks!

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE Frameworks 5





More information about the xdg mailing list