chore(bar): delete temperature and related reading logic

This commit is contained in:
Runze
2025-08-09 14:08:39 +08:00
parent 94176fad83
commit 9b5713d6b4
2 changed files with 0 additions and 41 deletions
@@ -21,14 +21,6 @@ Rectangle {
anchors.centerIn: parent
spacing: 8
RowLayout {
spacing: 5
Layout.fillWidth: true
MaterialSymbol { text: "thermostat"; color: Appearance.m3colors.m3onSecondaryContainer }
StyledText { text: Translation.tr("Temperature:"); color: Appearance.colors.colOnLayer1 }
StyledText { Layout.fillWidth: true; horizontalAlignment: Text.AlignRight; color: Appearance.colors.colOnLayer1; text: `${Battery.temperature}°C` }
}
// This row is hidden when the battery is full.
RowLayout {
spacing: 5
@@ -26,39 +26,6 @@ Singleton {
property real energyRate: UPower.displayDevice.changeRate
property real timeToEmpty: UPower.displayDevice.timeToEmpty
property real timeToFull: UPower.displayDevice.timeToFull
property real temperature: 0
Process {
id: tempProcess
command: ["bash", "-c", "cat /sys/class/thermal/thermal_zone0/temp"]
stdout: StdioCollector {
onStreamFinished: {
if (text && text.trim() !== "") {
Battery.temperature = parseInt(text.trim()) / 1000
} else {
Battery.temperature = 0
}
}
}
}
Timer {
interval: 3000
repeat: true
running: true
onTriggered: {
if (!tempProcess.running) {
tempProcess.running = true
}
}
}
Component.onCompleted: {
if (!tempProcess.running) {
tempProcess.running = true;
}
}
onIsLowAndNotChargingChanged: {
if (available && isLowAndNotCharging) Quickshell.execDetached([