XDG Default Applications specification proposal

Thayne astrothayne at gmail.com
Fri Jul 17 04:27:24 UTC 2020

On Fri, Jul 10, 2020 at 12:33 PM Dasith Gunawardhana <dasith at dg10a.com> wrote:
> Hi,
> Windows recently introduced their "Hosted Apps" model. I think a similar concept will work well for this problem. It would require an extension to the Desktop Entry Specification and a new Default Apps Specification.
> If an application requires another application as an executor or runtime, i.e. a "host", it has the "Host" key defined in its desktop entry.
> The "Host" value is one of two things:
> - a reverse DNS name declaring the host application type.
> - a path to an executable
> Some examples of host application types could be:
> - org.freedesktop.defaultapp.Browser
> - org.freedesktop.defaultapp.Terminal
> For each host application type we create a file in the directory "$XDG_CONFIG_HOME/deault-apps" with the same reverse DNS name. Some ideas for what that file would look like:
> 1.
>     # org.freedesktop.defaultapp.Terminal
>     Exec=alacritty -e

That also seems like a reasonable way to do it to me. I wrote the spec
I did because it mirrors the MIME spec, but other than that I don't
have any preference between that and this.

> 2. Just a symlink to a desktop entry or executable on the system.

The difficult with this would be that the options used when launching
a terminal application with a terminal may be different than the
options used to launch the terminal by itself. For example the `-e`
option in alacritty would be needed when it is used to launch another
app, but not when it is started by itself

> This would allow for:
> - Setting the default terminal
> - Creating desktop entries for non-applications like individual web pages, PWAs, or scripts, all with the executor determined at runtime, instead of being predefined in the desktop entry.

The ability to use non-applications as default apps is cool. Although
I suppose you could create .desktop files for those currently.

More information about the xdg mailing list