From 15bed9293ad7fb0b54cef68cdbf1a0549ec7aa97 Mon Sep 17 00:00:00 2001 From: Aargh Rai Date: Mon, 8 Dec 2025 12:01:07 +0530 Subject: forgot about cpu temperature --- quickshell/cpu_temp.sh | 2 ++ quickshell/shell.qml | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 quickshell/cpu_temp.sh (limited to 'quickshell') 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 -- cgit v1.2.3