added a lil' fella
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user