From 45d78359a7540ec890df826fc11c0e88a603a17a Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Thu, 22 Jun 2017 04:18:33 +0700 Subject: [PATCH 1/2] CPU [Linux]: Fix inaccurate ARM CPU on SoC systems --- neofetch | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/neofetch b/neofetch index 7c3ab813..13bef3cb 100755 --- a/neofetch +++ b/neofetch @@ -828,26 +828,22 @@ get_cpu() { case "$os" in "Linux" | "MINIX" | "Windows") # Get CPU name. - case "$distro" in - "Android"*) cpu="$(getprop ro.product.board)" ;; - *) - case "$machine_arch" in - "frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*) - cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' /proc/cpuinfo)" - ;; - "s390"*) - cpu="$(awk -F'=' '/machine/ {print $4; exit}' /proc/cpuinfo)" - ;; - "ia64" | "m32r") - cpu="$(awk -F':' '/model/ {print $2; exit}' /proc/cpuinfo)" - [[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' /proc/cpuinfo)" - ;; - *) - cpu="$(awk -F ': | @' '/model name|Processor|^cpu model|chip type|^cpu type/ {printf $2; exit}' /proc/cpuinfo)" - ;; - esac - ;; - esac + case "$machine_arch" in + "frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*) + cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' /proc/cpuinfo)" + ;; + "s390"*) + cpu="$(awk -F'=' '/machine/ {print $4; exit}' /proc/cpuinfo)" + ;; + "ia64" | "m32r") + cpu="$(awk -F':' '/model/ {print $2; exit}' /proc/cpuinfo)" + [[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' /proc/cpuinfo)" + ;; + *) + cpu="$(awk -F ': | @' '/model name|Processor|^cpu model|chip type|^cpu type/ {printf $2; exit}' /proc/cpuinfo)" + [[ "$cpu" == *"processor rev"* ]] && cpu="$(awk -F':' '/Hardware/ {print $2; exit}' /proc/cpuinfo)" + ;; + esac speed_dir="/sys/devices/system/cpu/cpu0/cpufreq" temp_dir="/sys/class/hwmon/hwmon0/temp1_input" @@ -1047,6 +1043,7 @@ get_cpu() { cpu="${cpu//, altivec supported}" cpu="${cpu//FPU*}" cpu="${cpu//Chip Revision*}" + cpu="${cpu//Technologies, Inc}" # Trim spaces from core output cores="${cores//[[:space:]]}" @@ -1068,6 +1065,7 @@ get_cpu() { cpu="${cpu/AMD }" cpu="${cpu/Intel }" cpu="${cpu/Core? Duo }" + cpu="${cpu/Qualcomm }" [[ "$cpu_shorthand" == "tiny" ]] && cpu="${cpu/@*}" ;; From 633a05175d2a6e441ba3aa45b2f372a748bfd584 Mon Sep 17 00:00:00 2001 From: Muhammad Herdiansyah Date: Thu, 22 Jun 2017 12:53:37 +0700 Subject: [PATCH 2/2] Docs: Changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8048c9eb..20ddd834 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ ## Contributors +## Info + +**CPU** + +- [Linux] Fixed inaccurate output on ARM SoC devices.