updates now checks helper

This commit is contained in:
2026-04-05 13:49:50 +02:00
parent b95f1cfd9d
commit 2e9792cdff
+26 -2
View File
@@ -10,6 +10,7 @@ Singleton {
id: root
property int availableUpdates: 0
property bool commandReady
property bool loaded
property double now: Date.now()
property var updates: ({})
@@ -46,7 +47,7 @@ Singleton {
running: true
onTriggered: {
if (!root.loaded)
if (!root.loaded || !root.commandReady)
return;
updatesProc.running = true;
@@ -62,10 +63,33 @@ Singleton {
onTriggered: root.now = Date.now()
}
Process {
id: cmdDetect
command: ["sh", "-c", "command -v yay || command -v paru"]
running: true
stdout: StdioCollector {
onStreamFinished: {
const cmd = this.text.trim();
let helper;
if (cmd.length > 0) {
helper = cmd.split("/").pop();
} else {
helper = "pacman";
}
updatesProc.command = [helper, "-Qu"];
root.commandReady = true;
}
}
}
Process {
id: updatesProc
command: ["checkupdates"]
command: []
running: false
stdout: StdioCollector {