File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -52,9 +52,11 @@ print_cpu_usage() {
5252
5353 local cpu_view=" $cpu_view_tmpl "
5454 cpu_view=" ${cpu_view// ' #{cpu.pused}' / $(printf " %.1f%%" " $cpu_pused " )} "
55- cpu_view=" ${cpu_view// ' #{cpu.color}' / $cpu_color } "
55+ cpu_view=" ${cpu_view// ' #{cpu.color}' / $(echo " $cpu_color " | awk ' { print $1 }' )} "
56+ cpu_view=" ${cpu_view// ' #{cpu.color2}' / $(echo " $cpu_color " | awk ' { print $2 }' )} "
57+ cpu_view=" ${cpu_view// ' #{cpu.color3}' / $(echo " $cpu_color " | awk ' { print $3 }' )} "
5658
57- echo $cpu_view
59+ echo " $cpu_view "
5860}
5961
6062main (){
Original file line number Diff line number Diff line change 33CURRENT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
44source " $CURRENT_DIR /helpers.sh"
55
6+ loadavg_per_cpu_core=$( get_tmux_option " @sysstat_loadavg_per_cpu_core" " true" )
7+
68get_num_of_cores (){
79 is_osx && sysctl -n hw.ncpu || nproc
810}
911
10- main (){
11- echo " $( date) " >> ~ /.tmux/sysstat_loadavg.log
12-
13- local loadavg_per_cpu_core=$( get_tmux_option " @sysstat_loadavg_per_cpu_core" " true" )
12+ main (){
1413 local num_cores=$( [ " $loadavg_per_cpu_core " == " true" ] && get_num_of_cores || echo 1)
1514
1615 uptime | awk -v num_cores=" $num_cores " ' {
You can’t perform that action at this time.
0 commit comments