Merge branch 'master' of https://github.com/ethancedwards8/tmux into freebsd_support
This commit is contained in:
commit
47fe175441
6 changed files with 50 additions and 4 deletions
|
@ -1,5 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# function for getting the refresh rate
|
||||
get_tmux_option() {
|
||||
local option=$1
|
||||
local default_value=$2
|
||||
local option_value=$(tmux show-option -gqv "$option")
|
||||
if [ -z $option_value ]; then
|
||||
echo $default_value
|
||||
else
|
||||
echo $option_value
|
||||
fi
|
||||
}
|
||||
|
||||
get_percent()
|
||||
{
|
||||
case $(uname -s) in
|
||||
|
@ -21,9 +33,11 @@ get_percent()
|
|||
|
||||
main()
|
||||
{
|
||||
# storing the refresh rate in the variable RATE, default is 5
|
||||
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
|
||||
cpu_percent=$(get_percent)
|
||||
echo "CPU $cpu_percent"
|
||||
sleep 10
|
||||
sleep $RATE
|
||||
}
|
||||
|
||||
# run main driver
|
||||
|
|
|
@ -31,6 +31,8 @@ main()
|
|||
show_cpu_usage=$(get_tmux_option "@dracula-cpu-usage" false)
|
||||
show_ram_usage=$(get_tmux_option "@dracula-ram-usage" false)
|
||||
show_gpu_usage=$(get_tmux_option "@dracula-gpu-usage" false)
|
||||
show_time=$(get_tmux_option "@dracula-show-time" true)
|
||||
show_refresh=$(get_tmux_option "@dracula-refresh-rate" 5)
|
||||
|
||||
# Dracula Color Pallette
|
||||
white='#f8f8f2'
|
||||
|
@ -78,7 +80,7 @@ main()
|
|||
esac
|
||||
|
||||
# sets refresh interval to every 5 seconds
|
||||
tmux set-option -g status-interval 5
|
||||
tmux set-option -g status-interval $show_refresh
|
||||
|
||||
# set clock to 12 hour by default
|
||||
tmux set-option -g clock-mode-style 12
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# function for getting the refresh rate
|
||||
get_tmux_option() {
|
||||
local option=$1
|
||||
local default_value=$2
|
||||
local option_value=$(tmux show-option -gqv "$option")
|
||||
if [ -z $option_value ]; then
|
||||
echo $default_value
|
||||
else
|
||||
echo $option_value
|
||||
fi
|
||||
}
|
||||
|
||||
get_platform()
|
||||
{
|
||||
case $(uname -s) in
|
||||
|
@ -27,9 +39,11 @@ get_gpu()
|
|||
}
|
||||
main()
|
||||
{
|
||||
# storing the refresh rate in the variable RATE, default is 5
|
||||
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
|
||||
gpu_usage=$(get_gpu)
|
||||
echo "GPU $gpu_usage"
|
||||
sleep 10
|
||||
sleep $RATE
|
||||
}
|
||||
# run the main driver
|
||||
main
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# function for getting the refresh rate
|
||||
get_tmux_option() {
|
||||
local option=$1
|
||||
local default_value=$2
|
||||
local option_value=$(tmux show-option -gqv "$option")
|
||||
if [ -z $option_value ]; then
|
||||
echo $default_value
|
||||
else
|
||||
echo $option_value
|
||||
fi
|
||||
}
|
||||
|
||||
get_percent()
|
||||
{
|
||||
case $(uname -s) in
|
||||
|
@ -56,9 +68,11 @@ get_percent()
|
|||
|
||||
main()
|
||||
{
|
||||
# storing the refresh rate in the variable RATE, default is 5
|
||||
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
|
||||
ram_percent=$(get_percent)
|
||||
echo "RAM $ram_percent"
|
||||
sleep 10
|
||||
sleep $RATE
|
||||
}
|
||||
|
||||
#run main driver
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue