From fd2248daec83ac8fbd5a0f8f2d9a135588149732 Mon Sep 17 00:00:00 2001 From: saeziae Date: Thu, 8 Sep 2022 22:55:50 +0800 Subject: [PATCH] merge riscv and loongarch to others --- neofetch | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/neofetch b/neofetch index 18901304..89332df0 100755 --- a/neofetch +++ b/neofetch @@ -2209,25 +2209,15 @@ get_cpu() { "arm"* | "aarch64") if [[ $(trim "$distro") == Android* ]]; then # Android roms have modified cpuinfo that shows CPU model as a string - cpu="$(awk -F '\\s*: | @' \ - '/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ { - cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")" + cpu="$(awk -F':' '/Hardware/ {print $2; exit}' "$cpu_file")" else cpu="$(lscpu | awk -F': ' '/Vendor ID/ {print $2; exit}' ) $(lscpu | awk -F': ' '/Model name/ {print $2; exit}')" fi ;; - "riscv"*) - cpu="$(awk -F': ' '/uarch/ {print $2; exit}' "$cpu_file")" - ;; - - "loongarch"*) - cpu="$(awk -F': ' '/Model/ {print $2; exit}' "$cpu_file")" - ;; - *) cpu="$(awk -F '\\s*: | @' \ - '/model name|Hardware|Processor|^cpu model|chip type|^cpu type/ { + '/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ { cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")" ;; esac