From e723af3293384e8a0f4fa06d7c1a88e11ebe4351 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 17 Sep 2025 23:39:09 +1000 Subject: idlemonitor: inhibit when audio playing --- README.md | 1 + config/GeneralConfig.qml | 1 + modules/IdleMonitors.qml | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index f9e001c..89281d2 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,7 @@ default, you must create it manually. "audio": ["pavucontrol"] }, "idle": { + "inhibitWhenAudio": true, "lockTimeout": 180, "dpmsTimeout": 300, "sleepTimeout": 600 diff --git a/config/GeneralConfig.qml b/config/GeneralConfig.qml index 91c85fc..dc6222e 100644 --- a/config/GeneralConfig.qml +++ b/config/GeneralConfig.qml @@ -12,6 +12,7 @@ JsonObject { } component Idle: JsonObject { + property bool inhibitWhenAudio: true property real lockTimeout: 180 // 3 mins property real dpmsTimeout: 300 // 5 mins property real sleepTimeout: 600 // 10 mins diff --git a/modules/IdleMonitors.qml b/modules/IdleMonitors.qml index ed929c4..3150973 100644 --- a/modules/IdleMonitors.qml +++ b/modules/IdleMonitors.qml @@ -8,8 +8,10 @@ Scope { id: root required property Lock lock + readonly property bool enabled: !Config.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying) IdleMonitor { + enabled: root.enabled timeout: Config.general.idle.lockTimeout onIsIdleChanged: { if (isIdle) @@ -18,6 +20,7 @@ Scope { } IdleMonitor { + enabled: root.enabled timeout: Config.general.idle.dpmsTimeout onIsIdleChanged: { if (isIdle) @@ -28,6 +31,7 @@ Scope { } IdleMonitor { + enabled: root.enabled timeout: Config.general.idle.sleepTimeout onIsIdleChanged: { if (isIdle) -- cgit v1.2.3-freya