I’m working on a snap for gnome-break-timer. Here’s a reference Flatpak manifest to get an idea what its sandbox needs to be shaped like: https://gitlab.gnome.org/GNOME/gnome-break-timer/-/blob/master/build-aux/flatpak/org.gnome.BreakTimer.Devel.json. So, it talks on these interfaces:
"--talk-name=org.gnome.ControlCenter",
"--talk-name=org.gnome.Shell",
"--talk-name=org.gnome.Mutter.IdleMonitor",
"--talk-name=org.gnome.ScreenSaver",
"--talk-name=org.freedesktop.Notifications"
Most of these are covered. We don’t need to worry about org.gnome.ControlCenter
for this (that’s just for some error handling around the XDG Background portal), but the application does need to talk with org.gnome.Mutter.IdleMonitor
. That’s an interface provided by Mutter that allows an application to see the session’s current idle time. It doesn’t look like there’s an existing snap interface I can use to talk with that dbus interface, and judging by the docs it looks like I should ask about that here, so here I am
Here’s the complete error message when the application tries to use the idle monitor interface:
** (gnome-break-timer-daemon:52189): WARNING **: 16:02:10.090: MutterActivityMonitorBackend.vala:78: Error adding mutter idle watch: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.138" (uid=1000 pid=52189 comm="gnome-break-timer-daemon " label="snap.gnome-break-timer.daemon (enforce)") interface="org.gnome.Mutter.IdleMonitor" member="AddIdleWatch" error name="(unset)" requested_reply="0" destination="org.gnome.Mutter.IdleMonitor" (uid=1000 pid=42370 comm="/usr/bin/gnome-shell " label="unconfined")
Note that org.gnome.Mutter.IdleMonitor
is one of many dbus names owned by GNOME Shell, so there are several other dbus objects related to it. Probably makes sense to be fine-grained with what this snap interface relates to, as I assume we’re doing with the screen-inhibit-control
interface.