23 lines
476 B
QML
23 lines
476 B
QML
pragma Singleton
|
|
|
|
import Quickshell
|
|
import Quickshell.Io
|
|
|
|
Singleton {
|
|
id: root
|
|
|
|
property real bpm
|
|
|
|
Process {
|
|
running: true
|
|
command: ["/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]);
|
|
}
|
|
}
|
|
}
|
|
}
|