added a lil' fella

This commit is contained in:
Sem
2026-04-18 00:40:26 +02:00
parent 24b0c41ffb
commit f8c8536ce3
4 changed files with 52 additions and 8 deletions

View File

@@ -20,14 +20,23 @@ Item {
root.artist = "";
root.title = "";
root.artUrl = "";
root.isPlaying = false;
return;
}
var parts = text.split("|||");
root.artist = parts[0] || "";
root.title = parts[1] || "";
root.artUrl = parts[2] || "";
root.isPlaying = (parts[3] || "").trim() === "Playing";
}
}
}
Process {
id: playerCtlPlayingProc
command: ["playerctl", "status"]
stdout: StdioCollector {
onStreamFinished: {
var status = this.text.trim();
root.isPlaying = (status === "Playing");
}
}
}
@@ -39,5 +48,12 @@ Item {
onTriggered: playerctlProc.running = true
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: playerCtlPlayingProc.running = true
}
Component.onCompleted: playerctlProc.running = true
}