diff --git a/1.5.md b/1.5.md index e6d829b2..8bde6482 100644 --- a/1.5.md +++ b/1.5.md @@ -10,6 +10,8 @@ **Disk Usage**
- Only display usage of local disks. +**CPU Information**
+- Option to shorten CPU name to just name, speed, tiny, on, or off ### Ascii diff --git a/README.md b/README.md index f7bcf776..87e79c1f 100644 --- a/README.md +++ b/README.md @@ -269,6 +269,8 @@ alias fetch2="fetch \ Possible values: current, min, max, bios, scaling_current, scaling_min, scaling_max NOTE: This only support Linux with cpufreq. + --cpu_shorthand type Shorten the output of CPU + Possible values: name, speed, tiny, on, off --kernel_shorthand on/off Shorten the output of kernel --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --gpu_shorthand on/off Shorten the output of GPU diff --git a/config/config b/config/config index 2fa40574..6026ab9e 100644 --- a/config/config +++ b/config/config @@ -93,6 +93,11 @@ shell_version="off" # scaling_current, scaling_min, scaling_max speed_type="max" +# CPU shorthand +# Decice to show name only, speed only, or short info +# --cpu_shorthand name, speed, tiny, on, off +cpu_shorthand="off" + # GPU diff --git a/neofetch b/neofetch index c1be7cec..effaf8a7 100755 --- a/neofetch +++ b/neofetch @@ -113,6 +113,11 @@ shell_version="off" # scaling_current, scaling_min, scaling_max speed_type="max" +# CPU shorthand +# Decice to show name only, speed only, or short info +# --cpu_shorthand name, speed, tiny, on, off +cpu_shorthand="off" + # GPU @@ -855,6 +860,28 @@ getcpu () { cpu=${cpu// Six-Core} cpu=${cpu// Eight-Core} cpu=${cpu// with Radeon HD Graphics} + + # Make the output of cpu shorter + case "$cpu_shorthand" in + "name") + cpu=${cpu/@*} + ;; + + "speed") + cpu=${cpu#*@ } + ;; + + "on" | "tiny") + cpu=${cpu/Intel } + cpu=${cpu/Core } + cpu=${cpu/Core? Duo } + cpu=${cpu/AMD } + + case "$cpu_shorthand" in + "tiny") cpu${cpu/@*} ;; + esac + ;; + esac } # }}} @@ -2295,6 +2322,8 @@ usage () { cat << EOF Possible values: current, min, max, bios, scaling_current, scaling_min, scaling_max NOTE: This only support Linux with cpufreq. + --cpu_shorthand type Shorten the output of CPU + Possible values: name, speed, tiny, on, off --kernel_shorthand on/off Shorten the output of kernel --uptime_shorthand on/off Shorten the output of uptime (tiny, on, off) --gpu_shorthand on/off Shorten the output of GPU @@ -2396,6 +2425,7 @@ while [ "$1" ]; do --speed_type) speed_type="$2" ;; --kernel_shorthand) kernel_shorthand="$2" ;; --uptime_shorthand) uptime_shorthand="$2" ;; + --cpu_shorthand) cpu_shorthand="$2" ;; --gpu_shorthand) gpu_shorthand="$2" ;; --gtk_shorthand) gtk_shorthand="$2" ;; --gtk2) gtk2="$2" ;; diff --git a/neofetch.1 b/neofetch.1 index f623f32c..28f43ac2 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -33,6 +33,11 @@ scaling_current, scaling_min, scaling_max .br NOTE: This only support Linux with cpufreq. .TP +.B \--cpu_shorthand 'type' +Shorten the output of CPU +.br +Possible values: name, speed, tiny, on, off +.TP .B \--kernel_shorthand 'on/off' Shorten the output of kernel .TP