summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre C. <alexandre.cuvillier59@gmail.com>2025-06-24 03:02:07 +0200
committerGitHub <noreply@github.com>2025-06-24 11:02:07 +1000
commit113134d61d15fd35ecadafe4972075f4333c9eeb (patch)
treef143518421c6d643c76b885b9ef5e70e9741f686
parentwallpapers: only preview dynamic if current (diff)
downloadcaelestia-shell-113134d61d15fd35ecadafe4972075f4333c9eeb.tar.gz
caelestia-shell-113134d61d15fd35ecadafe4972075f4333c9eeb.tar.bz2
caelestia-shell-113134d61d15fd35ecadafe4972075f4333c9eeb.zip
systemusage: fix CPU temps for AMD CPUs (#150)
-rw-r--r--services/SystemUsage.qml6
1 files changed, 5 insertions, 1 deletions
diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml
index 849070a..d015d2f 100644
--- a/services/SystemUsage.qml
+++ b/services/SystemUsage.qml
@@ -160,7 +160,11 @@ Singleton {
})
stdout: StdioCollector {
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)
root.cpuTemp = parseFloat(cpuTemp[1]);