mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
standardise naming & document defaults
This commit is contained in:
parent
de5bd9cf04
commit
08d029443f
|
|
@ -112,8 +112,8 @@ Here are all available options with their default values:
|
|||
|
||||
@cpu_percentage_format "%3.1f%%" # printf format to use to display percentage
|
||||
|
||||
@tmux_cpu_medium_threshold "70" # medium threshold
|
||||
@tmux_cpu_high_threshold "90" # high threshold
|
||||
@cpu_medium_thresh "30" # medium percentage threshold
|
||||
@cpu_high_thresh "80" # high percentage threshold
|
||||
```
|
||||
|
||||
Same options are valid with `@gpu`
|
||||
|
|
|
|||
|
|
@ -41,11 +41,11 @@ fcomp() {
|
|||
|
||||
load_status() {
|
||||
local percentage=$1
|
||||
tmux_cpu_high_threshold=$(get_tmux_option "@tmux_cpu_high_threshold" "80")
|
||||
tmux_cpu_medium_threshold=$(get_tmux_option "@tmux_cpu_medium_threshold" "30")
|
||||
if fcomp $tmux_cpu_high_threshold $percentage; then
|
||||
cpu_medium_thresh=$(get_tmux_option "@cpu_medium_thresh" "30")
|
||||
cpu_high_thresh=$(get_tmux_option "@cpu_high_thresh" "80")
|
||||
if fcomp $cpu_high_thresh $percentage; then
|
||||
echo "high"
|
||||
elif fcomp $tmux_cpu_medium_threshold $percentage && fcomp $percentage $tmux_cpu_high_threshold; then
|
||||
elif fcomp $cpu_medium_thresh $percentage && fcomp $percentage $cpu_high_thresh; then
|
||||
echo "medium"
|
||||
else
|
||||
echo "low"
|
||||
|
|
|
|||
Loading…
Reference in a new issue