diff --git a/README.md b/README.md index 5dcf1af3..320036fb 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,8 @@ alias neofetch2="neofetch \ NOTE: This only support Linux with cpufreq. --cpu_shorthand type Shorten the output of CPU 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) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/config/config b/config/config index d4cc28ba..54969a61 100644 --- a/config/config +++ b/config/config @@ -108,7 +108,9 @@ cpu_display="off" # CPU Cores # 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" diff --git a/neofetch b/neofetch index 74a48387..c5609cd9 100755 --- a/neofetch +++ b/neofetch @@ -725,9 +725,9 @@ getcpu() { fi # Show/hide hyperthreaded cores - case "$cores_ht" in - "on") cores="$(grep -c ^processor /proc/cpuinfo)" ;; - "off") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;; + case "$cpu_cores" in + "logical" | "on") cores="$(grep -c ^processor /proc/cpuinfo)" ;; + "physical") cores="$(grep "^core id" /proc/cpuinfo | sort -u | wc -l)" ;; esac # Fix for speeds under 1ghz @@ -744,9 +744,9 @@ getcpu() { cpu="$(sysctl -n machdep.cpu.brand_string)" # Show/hide hyperthreaded cores - case "$cores_ht" in - "on") cores="$(sysctl -n hw.logicalcpu_max)" ;; - "off") cores="$(sysctl -n hw.physicalcpu_max)" ;; + case "$cpu_cores" in + "logical" | "on") cores="$(sysctl -n hw.logicalcpu_max)" ;; + "physical") cores="$(sysctl -n hw.physicalcpu_max)" ;; esac ;; @@ -922,7 +922,7 @@ getcpu() { cpu="${cpu//with Radeon HD Graphics}" # Add cpu cores to output - [ "$cpu_cores" == "on" ] && [ "$cores" ] && \ + [ "$cpu_cores" != "off" ] && [ "$cores" ] && \ cpu="${cpu/@/(${cores}) @}" # Make the output of cpu shorter @@ -2956,7 +2956,8 @@ usage() { cat << EOF NOTE: This only support Linux with cpufreq. --cpu_shorthand type Shorten the output of CPU 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) NOTE: This is only possible on Linux, macOS, and Solaris --kernel_shorthand on/off Shorten the output of kernel diff --git a/neofetch.1 b/neofetch.1 index 71cbf2b9..7f8ac105 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -35,7 +35,7 @@ Shorten the output of CPU .br Possible values: name, speed, tiny, on, off .TP -.B \--cpu_cores 'on/off' +.B \--cpu_cores 'logical/physical/off' Whether or not to display the number of CPU cores .TP .B \--distro_shorthand 'on/off'