The desktop-launch interface

The desktop-launch interface allows strictly confined snaps to identify and launch desktop applications in (or from) other snaps.

Interface documentation:

See Interface management and Supported interfaces for further details on how interfaces are used.

Developer details

Auto-connect: no
Super-privileged: yes

Requires snapd version 2.52+.

Code examples

The source code for this interface is in the snapd repository:

Shouldn’t we add in this documentation that this interface is not for general use and is intended to run confined desktop shells.

I thought I could use it in my snaps.

I was also confused how to “use” this interface or if should specify it somewhere in my snapcraft.yaml. I am still not sure why Gimp calls this manually in the command-chain section.

For my application, I don’t need the command-chain entry. I assume it has something to do with the desktop entry in plugs. Maybe I am doing it wrong, but it works for me.

The desktop-launch interface that this document is describing is not the same as the desktop-launch script used by many graphical/desktop snap packages. The interface above is about granting permission to a snap package to launch executables from the system or other snaps from within its strict confinement. The script of the same name used by desktop snaps, however, is unrelated and is used to configure the runtime environment of the desktop snap so that the app can show it’s user interface and access things like audio, 3d acceleration, and gnome or kde services.