summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
Diffstat (limited to 'services')
-rw-r--r--services/Cava.qml19
1 files changed, 19 insertions, 0 deletions
diff --git a/services/Cava.qml b/services/Cava.qml
new file mode 100644
index 0000000..eaa6e20
--- /dev/null
+++ b/services/Cava.qml
@@ -0,0 +1,19 @@
+pragma Singleton
+
+import "root:/config"
+import Quickshell
+import Quickshell.Io
+
+Singleton {
+ id: root
+
+ property list<int> values
+
+ Process {
+ running: true
+ command: ["sh", "-c", `printf '[general]\nframerate=60\nbars=${DashboardConfig.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))
+ }
+ }
+}