Merge pull request #535 from dylanaraps/cpu_usage
CPU Usage: Add missing core commands and update old ones
This commit is contained in:
commit
d74587325c
1 changed files with 5 additions and 3 deletions
8
neofetch
8
neofetch
|
@ -929,11 +929,13 @@ get_cpu_usage() {
|
||||||
|
|
||||||
*)
|
*)
|
||||||
# Get cores if unset
|
# Get cores if unset
|
||||||
if [[ -z "$cores" ]]; then
|
if [[ "$cpu_cores" == "off" ]]; then
|
||||||
case "$os" in
|
case "$os" in
|
||||||
"Linux") cores="$(awk -F ': ' '/siblings/ {printf $2; exit}' /proc/cpuinfo)" ;;
|
"Linux") cores="$(grep -c "^processor" /proc/cpuinfo)" ;;
|
||||||
"Mac OS X" | "BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
"Mac OS X") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
||||||
|
"BSD") cores="$(sysctl -n hw.ncpu)" ;;
|
||||||
"Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
|
"Solaris") cores="$(kstat -m cpu_info | grep -c -F "chip_id")" ;;
|
||||||
|
"Haiku") cores="$(sysinfo -cpu | grep -c -F 'CPU #')" ;;
|
||||||
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
|
"iPhone OS") cores="${cpu/*\(}"; cores="${cores/\)*}" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue