aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2025-12-08 12:01:07 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2025-12-08 12:01:07 +0530
commit15bed9293ad7fb0b54cef68cdbf1a0549ec7aa97 (patch)
tree74755d6ea099bd9940e50a3709c6913102579def
parente6cf56ead8382d6bcd4d9f8d7a28490887bae92a (diff)
forgot about cpu temperature
-rwxr-xr-xquickshell/cpu_temp.sh2
-rw-r--r--quickshell/shell.qml15
2 files changed, 16 insertions, 1 deletions
diff --git a/quickshell/cpu_temp.sh b/quickshell/cpu_temp.sh
new file mode 100755
index 0000000..de73d7d
--- /dev/null
+++ b/quickshell/cpu_temp.sh
@@ -0,0 +1,2 @@
+temp=$(sensors | awk '/^Package id 0:/ {print int($4) + 273}')
+echo "$temp"
diff --git a/quickshell/shell.qml b/quickshell/shell.qml
index bc1290e..1ad2eb4 100644
--- a/quickshell/shell.qml
+++ b/quickshell/shell.qml
@@ -59,6 +59,18 @@ PanelWindow {
Component.onCompleted: running = true
}
+ property int cpu_temperature: 6000
+ Process {
+ id: temperatureProc
+ command: ["sh", "-c", "~/.config/quickshell/cpu_temp.sh"]
+ stdout: SplitParser {
+ onRead: data => {
+ cpu_temperature = parseInt(data.trim()) || 13;
+ }
+ }
+ Component.onCompleted: running = true
+ }
+
property int brightness: 100
property int temperature: 6000
Process {
@@ -122,6 +134,7 @@ PanelWindow {
volumeProc.running = true
batteryProc.running = true
networkProc.running = true
+ temperatureProc.running = true
}
}
Process {
@@ -265,7 +278,7 @@ PanelWindow {
}
}
Text {
- text: cpuUsage + "K"
+ text: cpu_temperature + "K"
color: root.orange
font {
family: root.fontFamily