systemusage: fix CPU temps for AMD CPUs (#150)
This commit is contained in:
parent
2a68d79422
commit
113134d61d
1 changed files with 5 additions and 1 deletions
|
|
@ -160,7 +160,11 @@ Singleton {
|
||||||
})
|
})
|
||||||
stdout: StdioCollector {
|
stdout: StdioCollector {
|
||||||
onStreamFinished: {
|
onStreamFinished: {
|
||||||
const cpuTemp = text.match(/Package id [0-9]+: *((\+|-)[0-9.]+)(°| )C/);
|
const cpuTemp = text.match(/(?:Package id [0-9]+|Tdie):\s+((\+|-)[0-9.]+)(°| )C/);
|
||||||
|
if (!cpuTemp) {
|
||||||
|
// If AMD Tdie pattern failed, try fallback on Tctl
|
||||||
|
const cpuTemp = text.match(/Tctl:\s+((\+|-)[0-9.]+)(°| )C/);
|
||||||
|
}
|
||||||
if (cpuTemp)
|
if (cpuTemp)
|
||||||
root.cpuTemp = parseFloat(cpuTemp[1]);
|
root.cpuTemp = parseFloat(cpuTemp[1]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue