diff options
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | config/GeneralConfig.qml | 1 | ||||
| -rw-r--r-- | modules/IdleMonitors.qml | 4 |
3 files changed, 6 insertions, 0 deletions
@@ -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) |