added the refresh rate by pulling from the .tmux.conf file and running

the get_tmux_option function and using that as the variable for the
refresh rate on sleep
This commit is contained in:
Ethan Edwards 2020-08-10 07:57:48 -04:00
parent f5f8dedb9f
commit e290571fee
4 changed files with 36 additions and 3 deletions

View file

@ -1,5 +1,16 @@
#!/usr/bin/env bash
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
@ -37,6 +48,7 @@ get_percent()
main()
{
RATE=$(get_tmux_option "@dracula-refresh-rate" 5)
ram_percent=$(get_percent)
echo "RAM $ram_percent"
sleep $RATE