summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--config/GeneralConfig.qml1
-rw-r--r--modules/IdleMonitors.qml4
3 files changed, 6 insertions, 0 deletions
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)