Configuration

PowerRequestMonitor

You can configure any number of <RequestFilterRule> to describe which power requests should be considered as usage.

<SystemMonitor>

  <PowerRequestMonitor watchOperation="sleep" watchMode="block|block-weak">

    <RequestFilterRule ... />
    <RequestFilterRule ... />

  </PowerRequestMonitor>

</SystemMonitor>

watchOperation

default:

sleep

OS:

🐧 Linux

Controls which inhibition operations are visible to the <PowerRequestMonitor>. Only locks whose operation matches one of the configured values are evaluated by filter rules and counted as usage. Multiple values can be combined with |.

sleep

Blocks or delays suspend and hibernate.

shutdown

Blocks or delays system shutdown and power-off.

reboot

Blocks or delays a system reboot.

idle

Blocks idle-triggered actions such as screen blanking, screensaver activation, and automatic suspend.

handle-power-key

Prevents logind from acting on the physical power button press.

handle-suspend-key

Prevents logind from acting on the suspend key.

handle-hibernate-key

Prevents logind from acting on the hibernate key.

handle-lid-switch

Prevents logind from reacting to the laptop lid being closed.

watchMode

default:

block|block-weak

OS:

🐧 Linux

Controls which inhibition modes are visible to the <PowerRequestMonitor>. Only locks whose mode matches one of the configured values are evaluated. Multiple values can be combined with |.

block

The operation is completely prevented for as long as the lock is held. Privileged processes can override this, but unprivileged applications cannot.

block-weak

A weaker variant of block that can be overridden by the system or a privileged process without releasing the lock. Used when an application wants to signal preference but not enforce it unconditionally.

delay

Does not prevent the operation, but delays it by a short window (configured in logind.conf via InhibitDelayMaxSec). The application is expected to perform any necessary cleanup within this window and then release the lock. Used by media players that need to flush buffers before a suspend.

RequestFilterRule

<RequestFilterRule type="MustNot" name="Backup">CBBackupPlan</RequestFilterRule>

type

default:

MustNot

This attribute determines if this is an inclusive or exclusive filter rule.

Must

Inclusive filters reduce the set of monitored resources to include only those that match at least one of the filters.

MustNot

Exclusive filters reduce the set of monitored resources by those that match with them.

name

You can provide any logical name here, to describe the power request or group of power requests. This name will be used to represent these requests in the log.

text

🔍 regex:

The text node of the <RequestFilterRule> will be parsed as a regular expression and matched against the name and reasons of the power request.