Interface request: Inhibit power management

Got this error:

wxD-Bus: Reply: Error: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender=":1.1399" (uid=12345 pid=16173 comm="/snap/filezilla/x8/bin/filezilla " label="snap.filezilla.filezilla (enforce)") interface="org.freedesktop.PowerManagement.Inhibit" member="Inhibit" error name="(unset)" requested_reply="0" destination="org.freedesktop.PowerManagement" (uid=12345 pid=4996 comm="/usr/lib/x86_64-linux-gnu/libexec/org_kde_powerdev" label="unconfined")

It seems that inhibiting power management haven’t been exposed as an interface yet, any thoughts?

1 Like

Looks sensible, if you have a use case we could craft an interface.

1 Like

Sure, the FileZilla snap I’m packaging(recipe) has a feature to “Prevent system from entering idle sleep during transfers and other operations”, I believe this is the one that calls the org.freedesktop.PowerManagement.Inhibit D-Bus interface.

I was going to say “we’ve already got that”, and then remembered it was on the phone
 :slight_smile:

1 Like

You are correct, this isn’t available yet. There is upower-observe, but that is different. If you are so inclined, please feel free to create a PR. You can base it on screen-inhibit-control. I suggest you name it ‘power-management-control’ to start, though that may change in PR review.