Skip to content

applets/battery: add support for blocking inhibitions, and unify layout for automatic and manual inhibitions

Add buttons in the inhibition hint using PowerDevil's new DBus interface to release and optionally permanently block inhibitions posted by apps.

block-inhibitions unblock-inhibition

Adopt the same layout in the manual inhibition control.

Before: After:
image image
image image

Motivation:
(1): see bug report
(2): This makes the UI less visually busy and puts more focus on the probably more interesting app inhibitions.

How to test:

  1. Build this together with the associated powerdevil MR
  2. Restart powerdevil: systemctl --user restart plasma-powerdevil.service and the Plasma applet
  3. Play a video and wait five seconds for the inhibition to appear
  4. Press the button
  5. Confirm computer automatically goes to sleep after the inactivity period set in power management settings even while video is still playing
  6. Confirm that the "every time" option will also take effect when you repeat the same steps again, and the "only this time" option will not
  7. Confirm the applet shows you a message informing about this, and that the "Block" button undoes it as expected

BUG: 423745

Depends on backend: powerdevil!363

CC @broulik @teams/vdg

Edited by Natalie Clarius

Merge request reports