mirror of
https://github.com/end-4/dots-hyprland.git
synced 2026-06-05 23:09:26 -05:00
chore(bar): delete temperature and related reading logic
This commit is contained in:
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user