summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph <code@c.onl>2025-11-10 20:56:48 +0100
committerChristoph <code@c.onl>2025-11-10 21:05:15 +0100
commit71d379904e61256487950bfd372ef84dd9ea9bea (patch)
tree46a8b74fdbd7d685020dbc3fce02fcdd74282706
parente68724182cd1e6b8f5be723cf6d0772f238ca526 (diff)
downloaddots-71d379904e61256487950bfd372ef84dd9ea9bea.tar.gz
polybar: Add CPU temperatureHEADmain
-rwxr-xr-xpolybar/OpenBSD-cpu-temp.sh6
-rw-r--r--polybar/config14
2 files changed, 19 insertions, 1 deletions
diff --git a/polybar/OpenBSD-cpu-temp.sh b/polybar/OpenBSD-cpu-temp.sh
new file mode 100755
index 0000000..728ab39
--- /dev/null
+++ b/polybar/OpenBSD-cpu-temp.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+while true; do
+ sysctl hw.sensors.ksmn0.temp | cut -d'=' -f2 | cut -d'.' -f1
+ sleep 1
+done
diff --git a/polybar/config b/polybar/config
index 87e51ff..9ba3be7 100644
--- a/polybar/config
+++ b/polybar/config
@@ -53,7 +53,7 @@ font-2 = Siji:pixelsize=10;1
modules-left = info-hlwm-workspaces xwindow
modules-center =
-modules-right = cpu memory storage battery wifi volume date
+modules-right = cpu cpu-temp memory storage battery wifi volume date
[module/volume]
interval = 1
@@ -64,6 +64,18 @@ format-prefix = "VOL: "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #C4C1DC
+[module/cpu-temp]
+interval = 1
+type = custom/script
+exec = "~/.config/polybar/plat.sh cpu-temp"
+tail = true
+format-foreground = ${colors.foreground-alt}
+format-prefix = "("
+format-prefix-foreground = ${colors.foreground-alt}
+format-suffix = "°)"
+format-suffix-foreground = ${colors.foreground-alt}
+format-underline = #DE965D
+
[module/storage]
interval = 1
type = custom/script