feat: add cava audio visualizer component

This commit is contained in:
tux
2026-08-23 12:06:05 +05:30
parent a1533e73c7
commit ae6628f549
3 changed files with 92 additions and 1 deletions

26
Cava.qml Normal file
View File

@@ -0,0 +1,26 @@
pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Io
Singleton {
id: root
readonly property string configPath: {
const url = Quickshell.shellPath("assets/cava.conf").toString();
return url.startsWith("file://") ? decodeURIComponent(url.substring(7)) : url;
}
property var values: []
Process {
running: true
command: ["cava", "-p", root.configPath]
stdout: SplitParser {
onRead: line => {
root.values = line.split(";").map(Number).filter(v => !Number.isNaN(v));
}
}
}
}