summaryrefslogtreecommitdiff
path: root/services/Cava.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-28 22:29:46 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-28 22:29:46 +1000
commitc1872c2d77065a9bcfe2f7953436c561f17290a3 (patch)
treee0fbf38929fb029c762789910f69c1b753215b9e /services/Cava.qml
parentdashboard: loader panes (diff)
downloadcaelestia-shell-c1872c2d77065a9bcfe2f7953436c561f17290a3.tar.gz
caelestia-shell-c1872c2d77065a9bcfe2f7953436c561f17290a3.tar.bz2
caelestia-shell-c1872c2d77065a9bcfe2f7953436c561f17290a3.zip
dashboard: optimise cava
Use refs to prevent loading at all times
Diffstat (limited to 'services/Cava.qml')
-rw-r--r--services/Cava.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/Cava.qml b/services/Cava.qml
index 3fa5083..5053984 100644
--- a/services/Cava.qml
+++ b/services/Cava.qml
@@ -8,12 +8,16 @@ Singleton {
id: root
property list<int> values
+ property int refCount
Process {
running: true
command: ["sh", "-c", `printf '[general]\nframerate=60\nbars=${Config.dashboard.visualiserBars}\n[output]\nchannels=mono\nmethod=raw\nraw_target=/dev/stdout\ndata_format=ascii\nascii_max_range=100' | cava -p /dev/stdin`]
stdout: SplitParser {
- onRead: data => root.values = data.slice(0, -1).split(";").map(v => parseInt(v, 10))
+ onRead: data => {
+ if (root.refCount)
+ root.values = data.slice(0, -1).split(";").map(v => parseInt(v, 10));
+ }
}
}
}