From 0636706ecf3e709bc7a2ed5fc225207ec2516a6a Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 23 Jan 2020 10:44:33 +0200 Subject: [PATCH] neofetch: Fix CPU temp on some systems --- neofetch | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/neofetch b/neofetch index d2937d70..72813772 100755 --- a/neofetch +++ b/neofetch @@ -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.