neofetch: Fix CPU temp on some systems

This commit is contained in:
Dylan Araps 2020-01-23 10:44:33 +02:00
parent 7fdaed2f94
commit 0636706ecf
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 5 additions and 2 deletions

View File

@ -1993,8 +1993,11 @@ get_cpu() {
# Select the right temperature file.
for temp_dir in /sys/class/hwmon/*; do
[[ "$(< "$temp_dir/name")" =~ (coretemp|fam15h_power|k10temp) ]] &&
{ temp_dir=$temp_dir/temp1_input; break; }
[[ "$(< "${temp_dir}/name")" =~ (coretemp|fam15h_power|k10temp) ]] && {
temp_dirs=("$temp_dir"/temp*_input)
temp_dir=${temp_dirs[0]}
break
}
done
# Get CPU speed.