Fix cpu temp colors not working when above high temp

pull/122/head
aristocratos 2020-05-11 19:56:26 +02:00
parent 55d0c3e2d2
commit cea0a87b96
1 changed files with 4 additions and 2 deletions

View File

@ -1944,12 +1944,14 @@ collect_cpu_temps() { #? Collect cpu temperatures
fi
if [[ $check_temp == true ]]; then
local tmp_temp="$(( (${cpu[temp_${i}]}-20)*100/(cpu[temp_high]-20) ))"
if ((tmp_temp>100)); then tmp_temp=100; elif ((tmp_temp<0)); then tmp_temp=0; fi
for((i=0;i<=threads;i++)); do
local -n cpu_temp_history="cpu_temp_history_$i"
if ((${#cpu_temp_history[@]}>20)); then
cpu_temp_history=( "${cpu_temp_history[@]:10}" "$(( (${cpu[temp_${i}]}-20)*100/(cpu[temp_high]-20) ))")
cpu_temp_history=( "${cpu_temp_history[@]:10}" "${tmp_temp}")
else
cpu_temp_history+=("$(( (${cpu[temp_${i}]}-20)*100/(cpu[temp_high]-20) ))")
cpu_temp_history+=("${tmp_temp}")
fi
done
fi