[PR] #34 from saeziae: fix some problem in detecting cpu such as loongson
This commit is contained in:
commit
f93315a7ad
1 changed files with 2 additions and 3 deletions
5
neofetch
5
neofetch
|
@ -2579,9 +2579,8 @@ END
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# If cpu is not detected on a platform-specific bases, fallback to cpuinfo method
|
# If cpu is not detected on a platform-specific bases, fallback to cpuinfo method
|
||||||
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' \
|
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ { print $2; exit}' "$cpu_file")"
|
||||||
'/model name|Model|uarch|Hardware|Processor|^cpu model|chip type|^cpu type/ {
|
[[ -z "$cpu" ]] && cpu="$(awk -F '\\s*: | @' '/Hardware/ {print $2; exit}' "$cpu_file")"
|
||||||
cpu=$2; if ($1 == "Hardware") exit } END { print cpu }' "$cpu_file")"
|
|
||||||
|
|
||||||
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
speed_dir="/sys/devices/system/cpu/cpu0/cpufreq"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue