initial commit
This commit is contained in:
commit
9fde6d4fc6
27 changed files with 1110 additions and 0 deletions
27
modules/Temperature.qml
Normal file
27
modules/Temperature.qml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import "." as M
|
||||
|
||||
Text {
|
||||
id: root
|
||||
|
||||
property int celsius: 0
|
||||
|
||||
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()
|
||||
}
|
||||
|
||||
text: " " + root.celsius + "°C"
|
||||
color: root.celsius > 80 ? M.Theme.base08 : M.Theme.base05
|
||||
font.pixelSize: M.Theme.fontSize
|
||||
font.family: M.Theme.fontFamily
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue