diff --git a/README.md b/README.md index f9e001c6..89281d2c 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 91c85fc8..dc6222e2 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 ed929c48..3150973f 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)