Update cpu_temp.sh

ryzen 3400G, ryzen 1600 closes #78
This commit is contained in:
basaran 2022-07-11 20:55:38 -04:00 committed by GitHub
parent 9eb3dba666
commit c58682089b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,7 +18,15 @@ print_cpu_temp() {
else
val="$(sensors)"
fi
echo "$val" | sed -e 's/^Tccd/Core /' | awk -v format="$cpu_temp_format$cpu_temp_unit" '/^Core [0-9]+/ {gsub("[^0-9.]", "", $3); sum+=$3; n+=1} END {printf(format, sum/n)}'
if [[ $val =~ Tcdd ]]; then
echo "$val" | sed -e 's/^Tccd/Core /' | awk -v format="$cpu_temp_format$cpu_temp_unit" '/^Core [0-9]+/ {gsub("[^0-9.]", "", $3); sum+=$3; n+=1} END {printf(format, sum/n)}'
elif [[ $val =~ Tctl ]]; then
echo "$val" | sed -n 's/Tctl:\s*+//p' | tr -d " "
elif [[ $val =~ Tdie ]]; then
echo "$val" | sed -n 's/Tdie:\s*+//p' | tr -d " "
else
echo "NA"
fi
fi
}