diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 13:22:45 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-06-22 13:22:45 +1000 |
| commit | 7f2b5b4b6f5ffde97948efc50eaa356944f112b1 (patch) | |
| tree | 3aef5012e5143b6f2dc514f4035793ec1f5f34d5 | |
| parent | network: fix for non english locales (diff) | |
| download | caelestia-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
| -rw-r--r-- | services/Bluetooth.qml | 8 | ||||
| -rw-r--r-- | services/Network.qml | 4 | ||||
| -rw-r--r-- | services/SystemUsage.qml | 27 |
3 files changed, 16 insertions, 23 deletions
diff --git a/services/Bluetooth.qml b/services/Bluetooth.qml index 224054d..0769095 100644 --- a/services/Bluetooth.qml +++ b/services/Bluetooth.qml @@ -28,8 +28,8 @@ Singleton { running: true command: ["bluetoothctl", "show"] environment: ({ - LANG: "C.UTF-8", - LC_ALL: "C.UTF-8" + LANG: "C", + LC_ALL: "C" }) stdout: StdioCollector { onStreamFinished: { @@ -51,8 +51,8 @@ Singleton { end end`] environment: ({ - LANG: "C.UTF-8", - LC_ALL: "C.UTF-8" + LANG: "C", + LC_ALL: "C" }) stdout: StdioCollector { onStreamFinished: { diff --git a/services/Network.qml b/services/Network.qml index 1106136..eb0d141 100644 --- a/services/Network.qml +++ b/services/Network.qml @@ -25,8 +25,8 @@ Singleton { running: true command: ["nmcli", "-g", "ACTIVE,SIGNAL,FREQ,SSID,BSSID", "d", "w"] environment: ({ - LANG: "C.UTF-8", - LC_ALL: "C.UTF-8" + LANG: "C", + LC_ALL: "C" }) stdout: StdioCollector { onStreamFinished: { 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; |