From 71d379904e61256487950bfd372ef84dd9ea9bea Mon Sep 17 00:00:00 2001 From: Christoph Date: Mon, 10 Nov 2025 20:56:48 +0100 Subject: polybar: Add CPU temperature --- polybar/OpenBSD-cpu-temp.sh | 6 ++++++ polybar/config | 14 +++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 polybar/OpenBSD-cpu-temp.sh 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 -- cgit v1.2.3