From d1f7c47e0c2972168589c1c7aed255dd706d9864 Mon Sep 17 00:00:00 2001 From: Andrew Titmuss Date: Fri, 11 Mar 2016 10:33:37 +1100 Subject: [PATCH] changed cpu_frequency outputs with @dylanaraps suggestions --- 1.5.md | 2 +- README.md | 2 +- config/config | 4 ++-- neofetch | 31 +++++++++++++++++-------------- neofetch.1 | 2 +- 5 files changed, 22 insertions(+), 19 deletions(-) diff --git a/1.5.md b/1.5.md index 2845aa26..8bde6482 100644 --- a/1.5.md +++ b/1.5.md @@ -11,7 +11,7 @@ **Disk Usage**
- Only display usage of local disks. **CPU Information**
-- Option to shorten CPU name to just name, model, name & model, or speed +- Option to shorten CPU name to just name, speed, tiny, on, or off ### Ascii diff --git a/README.md b/README.md index 981e692b..87e79c1f 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ alias fetch2="fetch \ scaling_current, scaling_min, scaling_max NOTE: This only support Linux with cpufreq. --cpu_shorthand type Shorten the output of CPU - Possible values: name, model, name_model, speed + 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 58fbde9f..6026ab9e 100644 --- a/config/config +++ b/config/config @@ -94,8 +94,8 @@ shell_version="off" speed_type="max" # CPU shorthand -# Decice to show name only, model only, or speed only -# --cpu_shorthand name, model, name_model, speed, off +# Decice to show name only, speed only, or short info +# --cpu_shorthand name, speed, tiny, on, off cpu_shorthand="off" diff --git a/neofetch b/neofetch index 62840bcd..f0a7b4ae 100755 --- a/neofetch +++ b/neofetch @@ -114,8 +114,8 @@ shell_version="off" speed_type="max" # CPU shorthand -# Decice to show name only, model only, or speed only -# --cpu_shorthand name, model, name_model, speed, off +# Decice to show name only, speed only, or short info +# --cpu_shorthand name, speed, tiny, on, off cpu_shorthand="off" @@ -864,22 +864,25 @@ getcpu () { # Make the output of cpu shorter case "$cpu_shorthand" in "name") - cpu=${cpu%-*} - ;; - - "model") - cpu=${cpu#*-} - cpu=${cpu%% *} - ;; - - "name_model") - cpu=${cpu%@*} - cpu=${cpu# } + cpu=${cpu/@*} ;; "speed") cpu=${cpu#*@ } ;; + + "on") + cpu=${cpu/Intel } + cpu=${cpu/Core } + cpu=${cpu/AMD } + ;; + + "tiny") + cpu=${cpu/Intel } + cpu=${cpu/Core } + cpu=${cpu/AMD } + cpu=${cpu/@*} + ;; esac } @@ -2322,7 +2325,7 @@ usage () { cat << EOF scaling_current, scaling_min, scaling_max NOTE: This only support Linux with cpufreq. --cpu_shorthand type Shorten the output of CPU - Possible values: name, model, name_model, speed + 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/neofetch.1 b/neofetch.1 index 0e8f9bdf..28f43ac2 100644 --- a/neofetch.1 +++ b/neofetch.1 @@ -36,7 +36,7 @@ NOTE: This only support Linux with cpufreq. .B \--cpu_shorthand 'type' Shorten the output of CPU .br -Possible values: name, model, name_model, speed +Possible values: name, speed, tiny, on, off .TP .B \--kernel_shorthand 'on/off' Shorten the output of kernel