diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:03 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:03 -0700 |
| commit | 7b21727285e50b0b050c4ddd70d07542229c5366 (patch) | |
| tree | 5d369153c5df5b41f3750d25479a68f20169c8ff /bin/st-cpu | |
init
Diffstat (limited to 'bin/st-cpu')
| -rwxr-xr-x | bin/st-cpu | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/st-cpu b/bin/st-cpu new file mode 100755 index 0000000..3d4e463 --- /dev/null +++ b/bin/st-cpu @@ -0,0 +1,25 @@ +#!/bin/sh +CPUTEMP=$(sensors | grep "Package id 0" | awk '{print $4}' | sed 's/+//;s/\.0//g' ) +#CPUFREQ=$(cat /sys/devices/system/cpu/cpufreq/policy1/scaling_cur_freq) +# +#if [ $CPUFREQ -gt 1000000 ]; then +# CPUFREQ="$(echo "scale=1; $CPUFREQ / 1000000" | bc) GHz" +#else +# CPUFREQ="$(echo "scale=0; $CPUFREQ / 1000" | bc) MHz" +#fi + +# freebsd +#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 |
