I am trying to enable the com.canonical.Unity.LauncherEntry interface in a snapped app. The app communicates loading progress via this interface’s update signal, so that e.g. the dock can visualize the progress. This already works when not snapped, but now I want to extend the snap to also allow access to this interface.
To enable DBus access I already set up slots in my snapcraft.yml like this:
apps: picard: # ... slots: - dbus-session-interface - dbus-canonical-launcher slots: dbus-session-interface: interface: dbus name: org.musicbrainz.Picard bus: session dbus-canonical-launcher: interface: dbus name: com.canonical.Unity.LauncherEntry bus: session
I also made sure that the app ID (which is supposed to match the .desktop file’s name) sent by the implementation as part of the update signal is
picard_picard.desktop, to follow the naming of the .desktop file as Snap uses it (so the dock can correlate the update signal to an entry it is showing).
This works partially. Inspecting DBus with D-Feet shows me the com.canonical.Unity.LauncherEntry for the object org.musicbrainz.Picard. I can also use the
query method of that interface with:
dbus-send --session --print-reply --dest=org.musicbrainz.Picard \ / com.canonical.Unity.LauncherEntry.Query
Which gives me the output:
method return time=1609837349.829729 sender=:1.1656 -> destination=:1.1657 serial=9 reply_serial=2 array [ variant string "application://picard_picard.desktop" variant array [ dict entry( string "progress" variant int32 0 ) dict entry( string "progress-visible" variant boolean false ) ] ]
But as soon as the snapped app tries to emit the
update singnal this apparmor error shows up in the journal:
Jan 05 09:51:05 zoidberg dbus-daemon: apparmor="DENIED" operation="dbus_signal" bus="session" path="/" interface="com.canonical.Unity.LauncherEntry" member="Update" mask="send" name="org.freedesktop.DBus" pid=64498 label="snap.picard.picard" peer_pid=31926 peer_label="unconfined"
What do I miss? Is there some way to grant the app full permission to use this interface?