mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-09 15:05:39 -05:00
replace dumb function
This commit is contained in:
@@ -358,6 +358,10 @@ Singleton {
|
||||
return (mem / (1024 * 1024)).toFixed(1) + " GB";
|
||||
}
|
||||
|
||||
function getCpuTempCentigrade() {
|
||||
cpuTempProcess.running = true;
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: updateTimer
|
||||
interval: root.updateInterval
|
||||
@@ -589,4 +593,18 @@ printf "}\\n"`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: cpuTempProcess
|
||||
command: ["bash", "-c", "grep -l 'coretemp\\|k10temp\\|k8temp\\|cpu_thermal\\|soc_thermal' /sys/class/hwmon/hwmon*/name | sed 's/name$/temp1_input/' | xargs cat | awk '{print $1/1000}'"]
|
||||
running: false
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
const temp = parseFloat(text.trim());
|
||||
if (!isNaN(temp)) {
|
||||
cpuTemperature = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user