standardise naming & document defaults

This commit is contained in:
Casper da Costa-Luis 2020-08-09 11:51:58 +01:00 committed by GitHub
parent de5bd9cf04
commit 08d029443f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -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`

View file

@ -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"