From d83c1ee9ff70844e5ca3e1766830df0c067820b4 Mon Sep 17 00:00:00 2001 From: pants Date: Fri, 9 Jan 2026 15:10:50 -0800 Subject: [PATCH] calculate average temp with sysctl values --- bin/st-temp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/bin/st-temp b/bin/st-temp index 04c9aef..e11cbf6 100755 --- a/bin/st-temp +++ b/bin/st-temp @@ -2,10 +2,17 @@ CPUTEMP=$(sensors | grep "Package id 0" | awk '{print $4}' | sed s/+// ) # freebsd -# calculate average from all cores (unfinished) -#CORETEMPS=$(hwstat | grep CPU | awk '{print $2}') - -# report only core 0 temp for now... -CPUTEMP="$(hwstat | grep CPU | awk 'NR==1 {print $2}')°C" +#CORETEMPS=$(sysctl dev.cpu | grep temperature | awk '{print $2}' | sed s/.[0-9]C$//g) +# +#CORE_COUNT=0 +#SUM=0 +# +#for temp in $CORETEMPS; do +# SUM=$((SUM + temp)) +# CORE_COUNT=$((CORE_COUNT + 1)) +#done +# +# +#CPUTEMP="$((SUM / CORE_COUNT)) C" echo $CPUTEMP