diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-25 00:54:38 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-25 00:54:38 +1000 |
| commit | cebb6270e483411cdbfe1deec97d202bc65845b6 (patch) | |
| tree | f2d4b3d9096d2474674b576d44e98654eb5f4ebd /services | |
| parent | systemusage: add NVIDIA GPU support to performance metrics (#156) (diff) | |
| download | caelestia-shell-cebb6270e483411cdbfe1deec97d202bc65845b6.tar.gz caelestia-shell-cebb6270e483411cdbfe1deec97d202bc65845b6.tar.bz2 caelestia-shell-cebb6270e483411cdbfe1deec97d202bc65845b6.zip | |
systemusage: add fallback for amd gpus
If they dont have edge, try use junction/mem
Diffstat (limited to 'services')
| -rw-r--r-- | services/SystemUsage.qml | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml index f4cbc4f..1a21cd5 100644 --- a/services/SystemUsage.qml +++ b/services/SystemUsage.qml @@ -184,10 +184,10 @@ Singleton { stdout: StdioCollector { onStreamFinished: { let cpuTemp = text.match(/(?:Package id [0-9]+|Tdie):\s+((\+|-)[0-9.]+)(°| )C/); - if (!cpuTemp) { + if (!cpuTemp) // If AMD Tdie pattern failed, try fallback on Tctl cpuTemp = text.match(/Tctl:\s+((\+|-)[0-9.]+)(°| )C/); - } + if (cpuTemp) root.cpuTemp = parseFloat(cpuTemp[1]); @@ -204,7 +204,11 @@ Singleton { else if (line === "") eligible = false; else if (eligible) { - const match = line.match(/^(temp[0-9]+|GPU core|edge)+:\s+\+([0-9]+\.[0-9]+)(°| )C/); + 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++; |