import QtQuick import Quickshell.Io import "." as M M.BarSection { id: root spacing: Math.max(1, M.Theme.moduleSpacing - 2) tooltip: "Temperature: " + root.celsius + "\u00B0C" property int celsius: 0 readonly property color _stateColor: celsius > 80 ? M.Theme.base08 : celsius > 60 ? M.Theme.base09 : M.Theme.base05 FileView { id: thermal path: "/sys/class/thermal/thermal_zone0/temp" onLoaded: root.celsius = Math.round(parseInt(text()) / 1000) } Timer { interval: 2000 running: true repeat: true onTriggered: thermal.reload() } M.BarIcon { icon: "\uF2C9" color: root._stateColor anchors.verticalCenter: parent.verticalCenter } Text { text: root.celsius + "\u00B0C" color: root._stateColor font.pixelSize: M.Theme.fontSize font.family: M.Theme.fontFamily verticalAlignment: Text.AlignVCenter } }