summaryrefslogtreecommitdiff
blob: 43442dc7689fa39e2831086beb1c1b1c9d6c6d60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
https://github.com/dylanaraps/neofetch/pull/2139

diff --git a/neofetch b/neofetch
index 1e4b5646..78babd0b 100755
--- a/neofetch
+++ b/neofetch
@@ -2086,9 +2086,18 @@ get_cpu() {
                     [[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
                 ;;
 
+                "arm"* | "aarch64")
+                    if [[ $(trim "$distro") == Android* ]]; then
+                    # Android roms have modified cpuinfo that shows CPU model as a string
+                        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
+                ;;
+
                 *)
                     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
@@ -2286,7 +2295,7 @@ get_cpu() {
     cpu="${cpu//, * Compute Cores}"
     cpu="${cpu//Core / }"
     cpu="${cpu//(\"AuthenticAMD\"*)}"
-    cpu="${cpu//with Radeon * Graphics}"
+    cpu="${cpu//with Radeon*Graphics}"
     cpu="${cpu//, altivec supported}"
     cpu="${cpu//FPU*}"
     cpu="${cpu//Chip Revision*}"