File tree Expand file tree Collapse file tree 13 files changed +17
-16
lines changed Expand file tree Collapse file tree 13 files changed +17
-16
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ get_bg_color_settings() {
20
20
21
21
print_bg_color () {
22
22
local cpu_percentage=$( $CURRENT_DIR /cpu_percentage.sh | sed -e ' s/%//' )
23
- local load_status=$( load_status $cpu_percentage )
23
+ local load_status=$( load_status $cpu_percentage " cpu " )
24
24
if [ $load_status == " low" ]; then
25
25
echo " $cpu_low_bg_color "
26
26
elif [ $load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ get_fg_color_settings() {
20
20
21
21
print_fg_color () {
22
22
local cpu_percentage=$( $CURRENT_DIR /cpu_percentage.sh | sed -e ' s/%//' )
23
- local load_status=$( load_status $cpu_percentage )
23
+ local load_status=$( load_status $cpu_percentage " cpu " )
24
24
if [ $load_status == " low" ]; then
25
25
echo " $cpu_low_fg_color "
26
26
elif [ $load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ get_icon_settings() {
22
22
23
23
print_icon () {
24
24
local cpu_percentage=$( $CURRENT_DIR /cpu_percentage.sh | sed -e ' s/%//' )
25
- local load_status=$( load_status $cpu_percentage )
25
+ local load_status=$( load_status $cpu_percentage " cpu " )
26
26
if [ $load_status == " low" ]; then
27
27
echo " $cpu_low_icon "
28
28
elif [ $load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ get_bg_color_settings() {
20
20
21
21
print_bg_color () {
22
22
local gpu_percentage=$( $CURRENT_DIR /gpu_percentage.sh | sed -e ' s/%//' )
23
- local gpu_load_status=$( load_status $gpu_percentage )
23
+ local gpu_load_status=$( load_status $gpu_percentage " gpu " )
24
24
if [ $gpu_load_status == " low" ]; then
25
25
echo " $gpu_low_bg_color "
26
26
elif [ $gpu_load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ get_fg_color_settings() {
20
20
21
21
print_fg_color () {
22
22
local gpu_percentage=$( $CURRENT_DIR /gpu_percentage.sh | sed -e ' s/%//' )
23
- local gpu_load_status=$( load_status $gpu_percentage )
23
+ local gpu_load_status=$( load_status $gpu_percentage " gpu " )
24
24
if [ $gpu_load_status == " low" ]; then
25
25
echo " $gpu_low_fg_color "
26
26
elif [ $gpu_load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ get_icon_settings() {
22
22
23
23
print_icon () {
24
24
local gpu_percentage=$( $CURRENT_DIR /gpu_percentage.sh | sed -e ' s/%//' )
25
- local gpu_load_status=$( load_status $gpu_percentage )
25
+ local gpu_load_status=$( load_status $gpu_percentage " gpu " )
26
26
if [ $gpu_load_status == " low" ]; then
27
27
echo " $gpu_low_icon "
28
28
elif [ $gpu_load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ get_bg_color_settings() {
20
20
21
21
print_bg_color () {
22
22
local gram_percentage=$( $CURRENT_DIR /gram_percentage.sh | sed -e ' s/%//' )
23
- local gram_load_status=$( load_status $gram_percentage )
23
+ local gram_load_status=$( load_status $gram_percentage " gram " )
24
24
if [ $gram_load_status == " low" ]; then
25
25
echo " $gram_low_bg_color "
26
26
elif [ $gram_load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ get_fg_color_settings() {
20
20
21
21
print_fg_color () {
22
22
local gram_percentage=$( $CURRENT_DIR /gram_percentage.sh | sed -e ' s/%//' )
23
- local gram_load_status=$( load_status $gram_percentage )
23
+ local gram_load_status=$( load_status $gram_percentage " gram " )
24
24
if [ $gram_load_status == " low" ]; then
25
25
echo " $gram_low_fg_color "
26
26
elif [ $gram_load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ get_icon_settings() {
22
22
23
23
print_icon () {
24
24
local gram_percentage=$( $CURRENT_DIR /gram_percentage.sh | sed -e ' s/%//' )
25
- local gram_load_status=$( load_status $gram_percentage )
25
+ local gram_load_status=$( load_status $gram_percentage " gram " )
26
26
if [ $gram_load_status == " low" ]; then
27
27
echo " $gram_low_icon "
28
28
elif [ $gram_load_status == " medium" ]; then
Original file line number Diff line number Diff line change @@ -47,11 +47,12 @@ fcomp() {
47
47
48
48
load_status () {
49
49
local percentage=$1
50
- cpu_medium_thresh=$( get_tmux_option " @cpu_medium_thresh" " 30" )
51
- cpu_high_thresh=$( get_tmux_option " @cpu_high_thresh" " 80" )
52
- if fcomp $cpu_high_thresh $percentage ; then
50
+ local prefix=$2
51
+ medium_thresh=$( get_tmux_option " @${prefix} _medium_thresh" " 30" )
52
+ high_thresh=$( get_tmux_option " @${prefix} _high_thresh" " 80" )
53
+ if fcomp $high_thresh $percentage ; then
53
54
echo " high"
54
- elif fcomp $cpu_medium_thresh $percentage && fcomp $percentage $cpu_high_thresh ; then
55
+ elif fcomp $medium_thresh $percentage && fcomp $percentage $high_thresh ; then
55
56
echo " medium"
56
57
else
57
58
echo " low"
You can’t perform that action at this time.
0 commit comments