Use cpu_cores
This commit is contained in:
parent
dc32c0b71c
commit
66100fc351
|
@ -364,7 +364,8 @@ alias neofetch2="neofetch \
|
||||||
NOTE: This only support Linux with cpufreq.
|
NOTE: This only support Linux with cpufreq.
|
||||||
--cpu_shorthand type Shorten the output of CPU
|
--cpu_shorthand type Shorten the output of CPU
|
||||||
Possible values: name, speed, tiny, on, off
|
Possible values: name, speed, tiny, on, off
|
||||||
--cpu_cores on/off Whether or not to display the number of CPU cores
|
--cpu_cores type Whether or not to display the number of CPU cores
|
||||||
|
Takes: logical. physical, off
|
||||||
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
|
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
|
||||||
NOTE: This is only possible on Linux, macOS, and Solaris
|
NOTE: This is only possible on Linux, macOS, and Solaris
|
||||||
--kernel_shorthand on/off Shorten the output of kernel
|
--kernel_shorthand on/off Shorten the output of kernel
|
||||||
|
|
|
@ -108,7 +108,9 @@ cpu_display="off"
|
||||||
|
|
||||||
# CPU Cores
|
# CPU Cores
|
||||||
# Display CPU cores in output
|
# Display CPU cores in output
|
||||||
# --cpu_cores on/off
|
# Logical: All virtual cores
|
||||||
|
# Physical: All physical cores
|
||||||
|
# --cpu_cores logical, physical, off
|
||||||
cpu_cores="on"
|
cpu_cores="on"
|
||||||
|
|
||||||
|
|
||||||
|
|
17
neofetch
17
neofetch
|
@ -725,9 +725,9 @@ getcpu() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Show/hide hyperthreaded cores
|
# Show/hide hyperthreaded cores
|
||||||
case "$cores_ht" in
|
case "$cpu_cores" in
|
||||||
"on") cores="$(grep -c ^processor /proc/cpuinfo)" ;;
|
"logical" | "on") cores="$(grep -c ^processor /proc/cpuinfo)" ;;
|
||||||
"off") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;;
|
"physical") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Fix for speeds under 1ghz
|
# Fix for speeds under 1ghz
|
||||||
|
@ -744,9 +744,9 @@ getcpu() {
|
||||||
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
cpu="$(sysctl -n machdep.cpu.brand_string)"
|
||||||
|
|
||||||
# Show/hide hyperthreaded cores
|
# Show/hide hyperthreaded cores
|
||||||
case "$cores_ht" in
|
case "$cpu_cores" in
|
||||||
"on") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
"logical" | "on") cores="$(sysctl -n hw.logicalcpu_max)" ;;
|
||||||
"off") cores="$(sysctl -n hw.physicalcpu_max)" ;;
|
"physical") cores="$(sysctl -n hw.physicalcpu_max)" ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -922,7 +922,7 @@ getcpu() {
|
||||||
cpu="${cpu//with Radeon HD Graphics}"
|
cpu="${cpu//with Radeon HD Graphics}"
|
||||||
|
|
||||||
# Add cpu cores to output
|
# Add cpu cores to output
|
||||||
[ "$cpu_cores" == "on" ] && [ "$cores" ] && \
|
[ "$cpu_cores" != "off" ] && [ "$cores" ] && \
|
||||||
cpu="${cpu/@/(${cores}) @}"
|
cpu="${cpu/@/(${cores}) @}"
|
||||||
|
|
||||||
# Make the output of cpu shorter
|
# Make the output of cpu shorter
|
||||||
|
@ -2956,7 +2956,8 @@ usage() { cat << EOF
|
||||||
NOTE: This only support Linux with cpufreq.
|
NOTE: This only support Linux with cpufreq.
|
||||||
--cpu_shorthand type Shorten the output of CPU
|
--cpu_shorthand type Shorten the output of CPU
|
||||||
Possible values: name, speed, tiny, on, off
|
Possible values: name, speed, tiny, on, off
|
||||||
--cpu_cores on/off Whether or not to display the number of CPU cores
|
--cpu_cores type Whether or not to display the number of CPU cores
|
||||||
|
Takes: logical. physical, off
|
||||||
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
|
--distro_shorthand on/off Shorten the output of distro (tiny, on, off)
|
||||||
NOTE: This is only possible on Linux, macOS, and Solaris
|
NOTE: This is only possible on Linux, macOS, and Solaris
|
||||||
--kernel_shorthand on/off Shorten the output of kernel
|
--kernel_shorthand on/off Shorten the output of kernel
|
||||||
|
|
|
@ -35,7 +35,7 @@ Shorten the output of CPU
|
||||||
.br
|
.br
|
||||||
Possible values: name, speed, tiny, on, off
|
Possible values: name, speed, tiny, on, off
|
||||||
.TP
|
.TP
|
||||||
.B \--cpu_cores 'on/off'
|
.B \--cpu_cores 'logical/physical/off'
|
||||||
Whether or not to display the number of CPU cores
|
Whether or not to display the number of CPU cores
|
||||||
.TP
|
.TP
|
||||||
.B \--distro_shorthand 'on/off'
|
.B \--distro_shorthand 'on/off'
|
||||||
|
|
Reference in New Issue