nosignal-shell/services/BeatDetector.qml
2 * r + 2 * t b8a4d1d312 internal: set default bpm to 1
So the media gif still plays even when beat detector doesnt work
2025-07-02 22:07:34 +10:00

22 lines
518 B
QML

pragma Singleton
import Quickshell
import Quickshell.Io
Singleton {
id: root
property real bpm: 1
Process {
running: true
command: [Quickshell.env("CAELESTIA_BD_PATH") || "/usr/lib/caelestia/beat_detector", "--no-log", "--no-stats", "--no-visual"]
stdout: SplitParser {
onRead: data => {
const match = data.match(/BPM: ([0-9]+\.[0-9])/);
if (match)
root.bpm = parseFloat(match[1]);
}
}
}
}