nosignal-shell/services/BeatDetector.qml
2 * r + 2 * t f1dc78d154 paths: use unified env var for lib dir
CAELESTIA_BD_PATH -> CAELESTIA_LIB_DIR/beat_detector
2025-08-27 14:43:14 +10:00

23 lines
494 B
QML

pragma Singleton
import qs.utils
import Quickshell
import Quickshell.Io
Singleton {
id: root
property real bpm: 150
Process {
running: true
command: [`${Paths.libdir}/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]);
}
}
}
}