mirror of
https://github.com/tmux-plugins/tmux-cpu.git
synced 2026-09-10 07:16:16 -04:00
Merge branch 'master' into ci
This commit is contained in:
commit
601872f3d0
|
|
@ -23,7 +23,7 @@ print_bg_color() {
|
|||
local cpu_percentage
|
||||
local load_status
|
||||
cpu_percentage=$("$CURRENT_DIR"/cpu_percentage.sh | sed -e 's/%//')
|
||||
load_status=$(load_status "$cpu_percentage")
|
||||
load_status=$(load_status "$cpu_percentage" "cpu")
|
||||
if [ "$load_status" == "low" ]; then
|
||||
echo "$cpu_low_bg_color"
|
||||
elif [ "$load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_fg_color() {
|
|||
local cpu_percentage
|
||||
local load_status
|
||||
cpu_percentage=$("$CURRENT_DIR"/cpu_percentage.sh | sed -e 's/%//')
|
||||
load_status=$(load_status "$cpu_percentage")
|
||||
load_status=$(load_status "$cpu_percentage" "cpu")
|
||||
if [ "$load_status" == "low" ]; then
|
||||
echo "$cpu_low_fg_color"
|
||||
elif [ "$load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ print_icon() {
|
|||
local cpu_percentage
|
||||
local load_status
|
||||
cpu_percentage=$("$CURRENT_DIR"/cpu_percentage.sh | sed -e 's/%//')
|
||||
load_status=$(load_status "$cpu_percentage")
|
||||
load_status=$(load_status "$cpu_percentage" "cpu")
|
||||
if [ "$load_status" == "low" ]; then
|
||||
echo "$cpu_low_icon"
|
||||
elif [ "$load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_bg_color() {
|
|||
local gpu_percentage
|
||||
local gpu_load_status
|
||||
gpu_percentage=$("$CURRENT_DIR"/gpu_percentage.sh | sed -e 's/%//')
|
||||
gpu_load_status=$(load_status "$gpu_percentage")
|
||||
gpu_load_status=$(load_status "$gpu_percentage" "gpu")
|
||||
if [ "$gpu_load_status" == "low" ]; then
|
||||
echo "$gpu_low_bg_color"
|
||||
elif [ "$gpu_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_fg_color() {
|
|||
local gpu_percentage
|
||||
local gpu_load_status
|
||||
gpu_percentage=$("$CURRENT_DIR"/gpu_percentage.sh | sed -e 's/%//')
|
||||
gpu_load_status=$(load_status "$gpu_percentage")
|
||||
gpu_load_status=$(load_status "$gpu_percentage" "gpu")
|
||||
if [ "$gpu_load_status" == "low" ]; then
|
||||
echo "$gpu_low_fg_color"
|
||||
elif [ "$gpu_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ print_icon() {
|
|||
local gpu_percentage
|
||||
local gpu_load_status
|
||||
gpu_percentage=$("$CURRENT_DIR"/gpu_percentage.sh | sed -e 's/%//')
|
||||
gpu_load_status=$(load_status "$gpu_percentage")
|
||||
gpu_load_status=$(load_status "$gpu_percentage" "gpu")
|
||||
if [ "$gpu_load_status" == "low" ]; then
|
||||
echo "$gpu_low_icon"
|
||||
elif [ "$gpu_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_bg_color() {
|
|||
local gram_percentage
|
||||
local gram_load_status
|
||||
gram_percentage=$("$CURRENT_DIR"/gram_percentage.sh | sed -e 's/%//')
|
||||
gram_load_status=$(load_status "$gram_percentage")
|
||||
gram_load_status=$(load_status "$gram_percentage" "gram")
|
||||
if [ "$gram_load_status" == "low" ]; then
|
||||
echo "$gram_low_bg_color"
|
||||
elif [ "$gram_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_fg_color() {
|
|||
local gram_percentage
|
||||
local gram_load_status
|
||||
gram_percentage=$("$CURRENT_DIR"/gram_percentage.sh | sed -e 's/%//')
|
||||
gram_load_status=$(load_status "$gram_percentage")
|
||||
gram_load_status=$(load_status "$gram_percentage" "gram")
|
||||
if [ "$gram_load_status" == "low" ]; then
|
||||
echo "$gram_low_fg_color"
|
||||
elif [ "$gram_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ print_icon() {
|
|||
local gram_percentage
|
||||
local gram_load_status
|
||||
gram_percentage=$("$CURRENT_DIR"/gram_percentage.sh | sed -e 's/%//')
|
||||
gram_load_status=$(load_status "$gram_percentage")
|
||||
gram_load_status=$(load_status "$gram_percentage" "gram")
|
||||
if [ "$gram_load_status" == "low" ]; then
|
||||
echo "$gram_low_icon"
|
||||
elif [ "$gram_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -52,11 +52,12 @@ fcomp() {
|
|||
|
||||
load_status() {
|
||||
local percentage=$1
|
||||
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
|
||||
local prefix=$2
|
||||
medium_thresh=$(get_tmux_option "@${prefix}_medium_thresh" "30")
|
||||
high_thresh=$(get_tmux_option "@${prefix}_high_thresh" "80")
|
||||
if fcomp "$high_thresh" "$percentage"; then
|
||||
echo "high"
|
||||
elif fcomp "$cpu_medium_thresh" "$percentage" && fcomp "$percentage" "$cpu_high_thresh"; then
|
||||
elif fcomp "$medium_thresh" "$percentage" && fcomp "$percentage" "$high_thresh"; then
|
||||
echo "medium"
|
||||
else
|
||||
echo "low"
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_bg_color() {
|
|||
local ram_percentage
|
||||
local ram_load_status
|
||||
ram_percentage=$("$CURRENT_DIR"/ram_percentage.sh | sed -e 's/%//')
|
||||
ram_load_status=$(load_status "$ram_percentage")
|
||||
ram_load_status=$(load_status "$ram_percentage" "ram")
|
||||
if [ "$ram_load_status" == "low" ]; then
|
||||
echo "$ram_low_bg_color"
|
||||
elif [ "$ram_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ print_fg_color() {
|
|||
local ram_percentage
|
||||
local ram_load_status
|
||||
ram_percentage=$("$CURRENT_DIR"/ram_percentage.sh | sed -e 's/%//')
|
||||
ram_load_status=$(load_status "$ram_percentage")
|
||||
ram_load_status=$(load_status "$ram_percentage" "ram")
|
||||
if [ "$ram_load_status" == "low" ]; then
|
||||
echo "$ram_low_fg_color"
|
||||
elif [ "$ram_load_status" == "medium" ]; then
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ print_icon() {
|
|||
local ram_percentage
|
||||
local ram_load_status
|
||||
ram_percentage=$("$CURRENT_DIR"/ram_percentage.sh | sed -e 's/%//')
|
||||
ram_load_status=$(load_status "$ram_percentage")
|
||||
ram_load_status=$(load_status "$ram_percentage" "ram")
|
||||
if [ "$ram_load_status" == "low" ]; then
|
||||
echo "$ram_low_icon"
|
||||
elif [ "$ram_load_status" == "medium" ]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue