Skip to content

Commit f41607c

Browse files
committed
cpu: Use HOSTTYPE
1 parent 077e5fa commit f41607c

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

neofetch

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -996,15 +996,8 @@ get_distro() {
996996

997997
[[ -z "$distro" ]] && distro="$os (Unknown)"
998998

999-
# Get OS architecture.
1000-
case "$os" in
1001-
"Solaris" | "AIX" | "Haiku" | "IRIX" | "FreeMiNT") machine_arch="$(uname -p)" ;;
1002-
*) machine_arch="$(uname -m)" ;;
1003-
1004-
esac
1005-
1006999
[[ "$os_arch" == "on" ]] && \
1007-
distro+=" ${machine_arch}"
1000+
distro+=" $HOSTTYPE"
10081001

10091002
[[ "${ascii_distro:-auto}" == "auto" ]] && \
10101003
ascii_distro="$(trim "$distro")"
@@ -1038,7 +1031,7 @@ get_model() {
10381031
;;
10391032

10401033
"iPhone OS")
1041-
case "$machine_arch" in
1034+
case "$kernel_machine" in
10421035
"iPad1,1") model="iPad" ;;
10431036
"iPad2,"[1-4]) model="iPad 2" ;;
10441037
"iPad3,"[1-3]) model="iPad 3" ;;
@@ -1739,7 +1732,7 @@ get_cpu() {
17391732
# Get CPU name.
17401733
cpu_file="/proc/cpuinfo"
17411734

1742-
case "$machine_arch" in
1735+
case "$kernel_machine" in
17431736
"frv" | "hppa" | "m68k" | "openrisc" | "or"* | "powerpc" | "ppc"* | "sparc"*)
17441737
cpu="$(awk -F':' '/^cpu\t|^CPU/ {printf $2; exit}' "$cpu_file")"
17451738
;;
@@ -1808,7 +1801,7 @@ get_cpu() {
18081801
;;
18091802

18101803
"iPhone OS")
1811-
case "$machine_arch" in
1804+
case "$kernel_machine" in
18121805
"iPhone1,"[1-2] | "iPod1,1") cpu="Samsung S5L8900 (1) @ 412MHz" ;;
18131806
"iPhone2,1") cpu="Samsung S5PC100 (1) @ 600MHz" ;;
18141807
"iPhone3,"[1-3] | "iPod4,1") cpu="Apple A4 (1) @ 800MHz" ;;
@@ -2119,7 +2112,7 @@ get_gpu() {
21192112
;;
21202113

21212114
"iPhone OS")
2122-
case "$machine_arch" in
2115+
case "$kernel_machine" in
21232116
"iPhone1,"[1-2]) gpu="PowerVR MBX Lite 3D" ;;
21242117
"iPhone5,"[1-4]) gpu="PowerVR SGX543MP3" ;;
21252118
"iPhone8,"[1-4]) gpu="PowerVR GT7600" ;;
@@ -4188,10 +4181,11 @@ dynamic_prompt() {
41884181
cache_uname() {
41894182
# Cache the output of uname so we don't
41904183
# have to spawn it multiple times.
4191-
IFS=" " read -ra uname <<< "$(uname -sr)"
4184+
IFS=" " read -ra uname <<< "$(uname -srm)"
41924185

41934186
kernel_name="${uname[0]}"
41944187
kernel_version="${uname[1]}"
4188+
kernel_machine="${uname[2]}"
41954189
}
41964190

41974191
convert_time() {

0 commit comments

Comments
 (0)