idlemonitor: inhibit when audio playing
This commit is contained in:
parent
24922be5e9
commit
e723af3293
3 changed files with 6 additions and 0 deletions
|
|
@ -254,6 +254,7 @@ default, you must create it manually.
|
||||||
"audio": ["pavucontrol"]
|
"audio": ["pavucontrol"]
|
||||||
},
|
},
|
||||||
"idle": {
|
"idle": {
|
||||||
|
"inhibitWhenAudio": true,
|
||||||
"lockTimeout": 180,
|
"lockTimeout": 180,
|
||||||
"dpmsTimeout": 300,
|
"dpmsTimeout": 300,
|
||||||
"sleepTimeout": 600
|
"sleepTimeout": 600
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ JsonObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Idle: JsonObject {
|
component Idle: JsonObject {
|
||||||
|
property bool inhibitWhenAudio: true
|
||||||
property real lockTimeout: 180 // 3 mins
|
property real lockTimeout: 180 // 3 mins
|
||||||
property real dpmsTimeout: 300 // 5 mins
|
property real dpmsTimeout: 300 // 5 mins
|
||||||
property real sleepTimeout: 600 // 10 mins
|
property real sleepTimeout: 600 // 10 mins
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,10 @@ Scope {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Lock lock
|
required property Lock lock
|
||||||
|
readonly property bool enabled: !Config.general.idle.inhibitWhenAudio || !Players.list.some(p => p.isPlaying)
|
||||||
|
|
||||||
IdleMonitor {
|
IdleMonitor {
|
||||||
|
enabled: root.enabled
|
||||||
timeout: Config.general.idle.lockTimeout
|
timeout: Config.general.idle.lockTimeout
|
||||||
onIsIdleChanged: {
|
onIsIdleChanged: {
|
||||||
if (isIdle)
|
if (isIdle)
|
||||||
|
|
@ -18,6 +20,7 @@ Scope {
|
||||||
}
|
}
|
||||||
|
|
||||||
IdleMonitor {
|
IdleMonitor {
|
||||||
|
enabled: root.enabled
|
||||||
timeout: Config.general.idle.dpmsTimeout
|
timeout: Config.general.idle.dpmsTimeout
|
||||||
onIsIdleChanged: {
|
onIsIdleChanged: {
|
||||||
if (isIdle)
|
if (isIdle)
|
||||||
|
|
@ -28,6 +31,7 @@ Scope {
|
||||||
}
|
}
|
||||||
|
|
||||||
IdleMonitor {
|
IdleMonitor {
|
||||||
|
enabled: root.enabled
|
||||||
timeout: Config.general.idle.sleepTimeout
|
timeout: Config.general.idle.sleepTimeout
|
||||||
onIsIdleChanged: {
|
onIsIdleChanged: {
|
||||||
if (isIdle)
|
if (isIdle)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue