Proposal for an intent-apps spec
Thomas Kluyver
thomas at kluyver.me.uk
Mon May 3 10:33:46 UTC 2021
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. 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.
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).
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.
Other than that, I think it looks like a nice addition. :-)
Thomas
On Mon, 3 May 2021, at 10:44, David Faure wrote:
> Hello everyone,
>
> I just created
> https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/45
> with the proposal for an intent-apps spec, modeled after the mime-apps spec
> (but without the concept of adding/removing associations).
>
> For context:
>
> * The desktop entry spec mentions Implement=<intent name> already for some
> time, but AFAIK this isn't used anywhere yet?
>
> * What's missing is a way to let the user (or the sysadmin or the distro)
> decide which alternative to prefer (possibly depending on the desktop
> environment). mimeapps does this nicely for mimetypes, so intentapps just
> reuses that solution, but outside the world of mimetypes
>
> * This came up in https://gitlab.freedesktop.org/xdg/xdg-specs/-/issues/54
> where we're discussing "Have a standard way for users to specify which
> terminal should open .desktop applications with Terminal=true".
> The solution involves implementing a DBus interface (dubbed
> org.freedesktop.Terminal1). This is similar to the existing
> org.freedesktop.FileManager1 DBus interface. All applications implementing
> org.freedesktop.Terminal1 will specify
> Implements=org.freedesktop.Terminal1 in their desktop file, and intent-
> apps.lst files can then be used to pick the preferred one.
>
> I am willing to implement this on the KDE side, I'm especially interested in
> feedback from whoever feels like implementing this in glib and other
> implementations.
>
> --
> David Faure, faure at kde.org, http://www.davidfaure.fr
> Working on KDE Frameworks 5
>
>
>
> _______________________________________________
> xdg mailing list
> xdg at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/xdg
>
More information about the xdg
mailing list