mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2024-12-18 05:40:07 +00:00
Bugfix: load segment changes the color reliably and is customizable.
This commit is contained in:
parent
61daa647f1
commit
69fc4d295c
1 changed files with 9 additions and 6 deletions
|
@ -583,15 +583,18 @@ prompt_load() {
|
||||||
base=K
|
base=K
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$5min_load_avg" -gt 10 ]]; then
|
if [[ "$load_avg_5min" -gt 10 ]]; then
|
||||||
BACKGROUND_COLOR="001"
|
BACKGROUND_COLOR="red"
|
||||||
elif [[ "$5min_load_avg" -gt 3 ]]; then
|
FUNCTION_SUFFIX="_CRITICAL"
|
||||||
BACKGROUND_COLOR="003"
|
elif [[ "$load_avg_5min" -gt 3 ]]; then
|
||||||
|
BACKGROUND_COLOR="yellow"
|
||||||
|
FUNCTION_SUFFIX="_WARNING"
|
||||||
else
|
else
|
||||||
BACKGROUND_COLOR="002"
|
BACKGROUND_COLOR="green"
|
||||||
|
FUNCTION_SUFFIX="_NORMAL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$1_prompt_segment "$0" $BACKGROUND_COLOR "$DEFAULT_COLOR" "$(print_icon 'LOAD_ICON') $load_avg_5min $(print_icon 'RAM_ICON') $(printSizeHumanReadable $ramfree $base)"
|
$1_prompt_segment "$0$FUNCTION_SUFFIX" $BACKGROUND_COLOR "$DEFAULT_COLOR" "$(print_icon 'LOAD_ICON') $load_avg_5min $(print_icon 'RAM_ICON') $(printSizeHumanReadable $ramfree $base)"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Right Status: (return code, root status, background jobs)
|
# Right Status: (return code, root status, background jobs)
|
||||||
|
|
Loading…
Reference in a new issue