Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions neofetch
Original file line number Diff line number Diff line change
Expand Up @@ -2587,6 +2587,18 @@ get_cpu() {
[[ -z "$cpu" ]] && cpu="$(awk -F':' '/family/ {printf $2; exit}' "$cpu_file")"
;;

"riscv"* | "rv"*)
cpu_uarch="$(awk -F':' '/uarch/ {print $2; exit}' "$cpu_file")"
# RISC-V ISA string example: "rv64imafdch_zicsr_zifencei".
cpu_isa="$(awk -F':' '/isa/ {print $2; exit}' "$cpu_file")"
# The _z parts are not important for CPU showcasing, so we remove them.
cpu_isa="${cpu_isa%%_*}"
# Then we replace "imafd" with "g" since "g" is a shorthand.
cpu_isa="${cpu_isa/imafd/g}"
# The final ISA output of the above example is "rv64gch".
cpu="$cpu_uarch $cpu_isa"
;;

"arm"* | "aarch64")
if [[ $(trim "$distro") == Android* ]]; then
# Android roms have modified cpuinfo that shows CPU model as a string
Expand Down