Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mrquantumoff committed Jan 7, 2023
1 parent 7d5da97 commit 041de8f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions nexfetch
Original file line number Diff line number Diff line change
Expand Up @@ -2208,9 +2208,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
Expand Down Expand Up @@ -2451,7 +2460,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*}"
Expand Down

0 comments on commit 041de8f

Please sign in to comment.