#!/bin/sh cpucount=$(cpufreq-info | grep "analyzing CPU" | wc -l) outp="" for cpu in $(seq 1 ${cpucount}); do temp=$(acpi -tBf | grep "Thermal ${cpu}" | tr -s , \ | cut -d\ -f5) t=${temp%%.*} color="{k.}" if [ $t -ge 140 ]; then color="{kr}" elif [ $t -ge 130 ]; then color="{ky}" fi cpu=$((cpu - 1 )) outp="${outp} $(echo "$color$temp{-} $(cpufreq-info -c ${cpu} -f)" |\ awk '{printf "%0.3fGHz (%sF)",$2/1000000,$1}')" done echo ${outp}