summaryrefslogtreecommitdiff
path: root/services/SystemUsage.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-22 13:22:45 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-06-22 13:22:45 +1000
commit7f2b5b4b6f5ffde97948efc50eaa356944f112b1 (patch)
tree3aef5012e5143b6f2dc514f4035793ec1f5f34d5 /services/SystemUsage.qml
parentnetwork: fix for non english locales (diff)
downloadcaelestia-shell-7f2b5b4b6f5ffde97948efc50eaa356944f112b1.tar.gz
caelestia-shell-7f2b5b4b6f5ffde97948efc50eaa356944f112b1.tar.bz2
caelestia-shell-7f2b5b4b6f5ffde97948efc50eaa356944f112b1.zip
systemusage: use sensors for cpu temps
Also fix lang and lc_all for procs
Diffstat (limited to 'services/SystemUsage.qml')
-rw-r--r--services/SystemUsage.qml27
1 files changed, 10 insertions, 17 deletions
diff --git a/services/SystemUsage.qml b/services/SystemUsage.qml
index d958dba..d508890 100644
--- a/services/SystemUsage.qml
+++ b/services/SystemUsage.qml
@@ -55,9 +55,8 @@ Singleton {
stat.reload();
meminfo.reload();
storage.running = true;
- cpuTemp.running = true;
gpuUsage.running = true;
- gpuTemp.running = true;
+ sensors.running = true;
}
}
@@ -137,20 +136,6 @@ Singleton {
}
Process {
- id: cpuTemp
-
- running: true
- command: ["sh", "-c", "cat /sys/class/thermal/thermal_zone*/temp"]
- stdout: StdioCollector {
- onStreamFinished: {
- const temps = text.trim().split(" ");
- const sum = temps.reduce((acc, d) => acc + parseInt(d, 10), 0);
- root.cpuTemp = sum / temps.length / 1000;
- }
- }
- }
-
- Process {
id: gpuUsage
running: true
@@ -165,12 +150,20 @@ Singleton {
}
Process {
- id: gpuTemp
+ id: sensors
running: true
command: ["sensors"]
+ environment: ({
+ LANG: "C",
+ LC_ALL: "C"
+ })
stdout: StdioCollector {
onStreamFinished: {
+ const cpuTemp = text.match(/Package id [0-9]+: *((\+|-)[0-9.]+)(°| )C/);
+ if (cpuTemp)
+ root.cpuTemp = parseFloat(cpuTemp[1]);
+
let eligible = false;
let sum = 0;
let count = 0;