Merge pull request #131 from iandrewt/cpu_shorthand
added ability to shorten cpu output
This commit is contained in:
commit
49de8d032f
5 changed files with 44 additions and 0 deletions
2
1.5.md
2
1.5.md
|
@ -10,6 +10,8 @@
|
|||
|
||||
**Disk Usage**<br \>
|
||||
- Only display usage of local disks.
|
||||
**CPU Information**<br \>
|
||||
- Option to shorten CPU name to just name, speed, tiny, on, or off
|
||||
|
||||
### Ascii
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
30
neofetch
30
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" ;;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue