Add options to disable battery and network

This commit is contained in:
Sergio D. Márquez 2020-04-21 00:35:04 +02:00
parent da1845eb8a
commit 8842bdf849
2 changed files with 16 additions and 3 deletions

View file

@ -26,7 +26,9 @@ Compatible with macOS and Linux. Tested on tmux 3.0a
## Options
Customize the status bar by adding any of these lines to your .tmux.conf as desired:
Disable weather functionality: `set -g @dracula-show-weather false`
* Disable battery functionality: `set -g @dracula-show-battery false`
* Disable network functionality: `set -g @dracula-show-network false`
* Disable weather functionality: `set -g @dracula-show-weather false`
## Team

View file

@ -18,6 +18,8 @@ main()
{
# set current directory variable
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
show_battery=$(get_tmux_option "@dracula-show-battery" true)
show_network=$(get_tmux_option "@dracula-show-network" true)
show_weather=$(get_tmux_option "@dracula-show-weather" true)
# Dracula Color Pallette
@ -60,11 +62,20 @@ main()
tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ☺ "
tmux set-option -g status-right ""
if $show_battery; then
tmux set-option -g status-right "#[fg=${dark_gray},bg=${pink}] #($current_dir/battery.sh) "
fi
if $show_network; then
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh) "
fi
if $show_weather; then
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt) "
fi
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) "
# window tabs