changed cpu_frequency outputs with @dylanaraps suggestions

This commit is contained in:
Andrew Titmuss 2016-03-11 10:33:37 +11:00
parent e0269fb9b6
commit d1f7c47e0c
5 changed files with 22 additions and 19 deletions

2
1.5.md
View file

@ -11,7 +11,7 @@
**Disk Usage**<br \>
- Only display usage of local disks.
**CPU Information**<br \>
- 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

View file

@ -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

View file

@ -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"

View file

@ -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

View file

@ -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