From f41607c36c01efee201e1019f12de730a3f70afc Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 31 May 2018 14:30:48 +1000 Subject: [PATCH] cpu: Use HOSTTYPE --- neofetch | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/neofetch b/neofetch index 5bffeb3c..04fe8192 100755 --- a/neofetch +++ b/neofetch @@ -996,15 +996,8 @@ get_distro() { [[ -z "$distro" ]] && distro="$os (Unknown)" - # Get OS architecture. - case "$os" in - "Solaris" | "AIX" | "Haiku" | "IRIX" | "FreeMiNT") machine_arch="$(uname -p)" ;; - *) machine_arch="$(uname -m)" ;; - - esac - [[ "$os_arch" == "on" ]] && \ - distro+=" ${machine_arch}" + distro+=" $HOSTTYPE" [[ "${ascii_distro:-auto}" == "auto" ]] && \ ascii_distro="$(trim "$distro")" @@ -1038,7 +1031,7 @@ get_model() { ;; "iPhone OS") - case "$machine_arch" in + case "$kernel_machine" in "iPad1,1") model="iPad" ;; "iPad2,"[1-4]) model="iPad 2" ;; "iPad3,"[1-3]) model="iPad 3" ;; @@ -1739,7 +1732,7 @@ get_cpu() { # Get CPU name. cpu_file="/proc/cpuinfo" - case "$machine_arch" in + case "$kernel_machine" in "frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*) cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")" ;; @@ -1808,7 +1801,7 @@ get_cpu() { ;; "iPhone OS") - case "$machine_arch" in + case "$kernel_machine" in "iPhone1,"[1-2] | "iPod1,1") cpu="Samsung S5L8900 (1) @ 412MHz" ;; "iPhone2,1") cpu="Samsung S5PC100 (1) @ 600MHz" ;; "iPhone3,"[1-3] | "iPod4,1") cpu="Apple A4 (1) @ 800MHz" ;; @@ -2119,7 +2112,7 @@ get_gpu() { ;; "iPhone OS") - case "$machine_arch" in + case "$kernel_machine" in "iPhone1,"[1-2]) gpu="PowerVR MBX Lite 3D" ;; "iPhone5,"[1-4]) gpu="PowerVR SGX543MP3" ;; "iPhone8,"[1-4]) gpu="PowerVR GT7600" ;; @@ -4188,10 +4181,11 @@ dynamic_prompt() { cache_uname() { # Cache the output of uname so we don't # have to spawn it multiple times. - IFS=" " read -ra uname <<< "$(uname -sr)" + IFS=" " read -ra uname <<< "$(uname -srm)" kernel_name="${uname[0]}" kernel_version="${uname[1]}" + kernel_machine="${uname[2]}" } convert_time() {