From bce73f68362c3b434fde572deafc35e628b6db3a Mon Sep 17 00:00:00 2001 From: saeziae Date: Thu, 3 Nov 2022 23:50:58 +0800 Subject: [PATCH] fix some problem in detecting cpu such as loongson --- neofetch | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/neofetch b/neofetch index a2ea5172..f990ada9 100755 --- a/neofetch +++ b/neofetch @@ -2573,9 +2573,8 @@ END esac # If cpu is not detected on a platform-specific bases, fallback to cpuinfo method - [[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' \ - '/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ { - cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")" + [[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ { print $2; exit}' "$cpu_file")" + [[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/Hardware/ {print $2; exit}' "$cpu_file")" speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"