Merge pull request #13 from smarquez1/master

Add options to disable battery and network
This commit is contained in:
Dane Williams 2020-04-20 17:11:16 -07:00 committed by GitHub
commit 91393555d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 ## Options
Customize the status bar by adding any of these lines to your .tmux.conf as desired: 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 ## Team

View file

@ -18,6 +18,8 @@ main()
{ {
# set current directory variable # set current directory variable
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 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) show_weather=$(get_tmux_option "@dracula-show-weather" true)
# Dracula Color Pallette # 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-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) " 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) " tmux set-option -ga status-right "#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh) "
fi
if $show_weather; then if $show_weather; then
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt) " tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt) "
fi fi
tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) " tmux set-option -ga status-right "#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) "
# window tabs # window tabs