updated components #122

Merged
zach merged 64 commits from feat/updated-components into main 2026-06-23 11:33:20 +02:00
Showing only changes of commit 2cb4d9b739 - Show all commits
+41 -1
View File
@@ -58,8 +58,10 @@ Singleton {
triggeredOnStart: true
onTriggered: {
if (root.gpuType === "GENERIC")
if (root.gpuType === "GENERIC") {
gpuUsage.running = true;
sensors.running = true;
}
if (root.gpuType === "GENERIC" && root.gpuMemTotal === 0)
oneshotMemAmd.running = true;
@@ -226,4 +228,42 @@ Singleton {
}
}
}
Process {
id: sensors
command: ["sensors"]
environment: ({
LANG: "C.UTF-8",
LC_ALL: "C.UTF-8"
})
stdout: StdioCollector {
onStreamFinished: {
let eligible = false;
let sum = 0;
let count = 0;
for (const line of text.trim().split("\n")) {
if (line === "Adapter: PCI adapter")
eligible = true;
else if (line === "")
eligible = false;
else if (eligible) {
let match = line.match(/^(temp[0-9]+|GPU core|edge)+:\s+\+([0-9]+\.[0-9]+)(°| )C/);
if (!match)
// Fall back to junction/mem if GPU doesn't have edge temp (for AMD GPUs)
match = line.match(/^(junction|mem)+:\s+\+([0-9]+\.[0-9]+)(°| )C/);
if (match) {
sum += parseFloat(match[2]);
count++;
}
}
}
root.gpuTemp = count > 0 ? sum / count : 0;
}
}
}
}