diff options
| -rwxr-xr-x | quickshell/cpu_temp.sh | 2 | ||||
| -rw-r--r-- | quickshell/shell.qml | 15 |
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 |
