From 6b18fd2d23628c676070f13ff7c630b6680594c3 Mon Sep 17 00:00:00 2001 From: Dane Williams Date: Fri, 29 May 2020 16:42:18 -0700 Subject: [PATCH 1/3] fixed weather and network extra spaces --- data/weather.txt | 2 +- scripts/dracula.sh | 4 ++-- scripts/network.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/data/weather.txt b/data/weather.txt index f4a4c99..2aee588 100644 --- a/data/weather.txt +++ b/data/weather.txt @@ -1 +1 @@ -☀ 100° Pleasanton, CA +☀ 78° Pleasanton, CA diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 9ecd9c5..3554acf 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -101,7 +101,7 @@ main() fi if $show_weather; then - tmux set-option -ga status-right "#[fg=${orange},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt) " + tmux set-option -ga status-right "#[fg=${orange},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt)" powerbg=${orange} fi @@ -127,7 +127,7 @@ main() fi 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 if $show_military; then diff --git a/scripts/network.sh b/scripts/network.sh index 6ec84ad..f95afda 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -43,7 +43,7 @@ main() fi done - echo " $network" + echo "$network" } #run main driver function From 078b59f0653811b500767149656c34a5db34f91d Mon Sep 17 00:00:00 2001 From: Dane Williams Date: Fri, 29 May 2020 16:50:58 -0700 Subject: [PATCH 2/3] cleaned up comments/formatting --- scripts/dracula.sh | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 3554acf..ca7f96f 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash + get_tmux_option() { local option=$1 local default_value=$2 @@ -26,6 +27,7 @@ main() show_left_sep=$(get_tmux_option "@dracula-show-left-sep" ) show_right_sep=$(get_tmux_option "@dracula-show-right-sep" ) show_border_contrast=$(get_tmux_option "@dracula-border-contrast" false) + # Dracula Color Pallette white='#f8f8f2' gray='#44475a' @@ -39,6 +41,8 @@ main() pink='#ff79c6' yellow='#f1fa8c' + + # Handle left icon configuration case $show_left_icon in smiley) left_icon="☺ ";; @@ -50,19 +54,22 @@ main() left_icon=$show_left_icon;; esac + # Handle powerline option if $show_powerline; then right_sep="$show_right_sep" left_sep="$show_left_sep" fi + # start weather script in background if $show_weather; then $current_dir/sleep_weather.sh $show_fahrenheit & fi - # set refresh interval + + # sets refresh interval to every 5 seconds tmux set-option -g status-interval 5 - # set clock + # set clock to 12 hour by default tmux set-option -g clock-mode-style 12 # set length @@ -75,7 +82,6 @@ main() else tmux set-option -g pane-active-border-style "fg=${dark_purple}" fi - tmux set-option -g pane-border-style "fg=${gray}" # message styling @@ -84,59 +90,61 @@ main() # status bar tmux set-option -g status-style "bg=${gray},fg=${white}" + + # Powerline Configuration if $show_powerline; then tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon} #[fg=${green},bg=${gray}]#{?client_prefix,#[fg=${yellow}],}${left_sep}" tmux set-option -g status-right "" powerbg=${gray} - if $show_battery; then + if $show_battery; then # battery tmux set-option -g status-right "#[fg=${pink},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${pink}] #($current_dir/battery.sh) " powerbg=${pink} fi - if $show_network; then + if $show_network; then # network tmux set-option -ga status-right "#[fg=${cyan},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh) " powerbg=${cyan} fi - if $show_weather; then + if $show_weather; then # weather tmux set-option -ga status-right "#[fg=${orange},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt)" powerbg=${orange} fi - if $show_military; then + if $show_military; then # military time tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %R #(date +%Z) " else tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) " fi - # window tabs tmux set-window-option -g window-status-current-format "#[fg=${gray},bg=${dark_purple}]${left_sep}#[fg=${white},bg=${dark_purple}] #I #W #[fg=${dark_purple},bg=${gray}]${left_sep}" + + # Non Powerline Configuration else tmux set-option -g status-left "#[bg=${green},fg=${dark_gray}]#{?client_prefix,#[bg=${yellow}],} ${left_icon}" tmux set-option -g status-right "" - if $show_battery; then + if $show_battery; then # battery tmux set-option -g status-right "#[fg=${dark_gray},bg=${pink}] #($current_dir/battery.sh) " fi - if $show_network; then + if $show_network; then # network tmux set-option -ga status-right "#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh) " fi - if $show_weather; then + if $show_weather; then # weather tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt)" fi - if $show_military; then + if $show_military; then # military time tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %R #(date +%Z) " else tmux set-option -ga status-right "#[fg=${dark_purple},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${white},bg=${dark_purple}] %a %m/%d %I:%M %p #(date +%Z) " fi - # window tabs tmux set-window-option -g window-status-current-format "#[fg=${white},bg=${dark_purple}] #I #W " fi From b3668cda4ac66dea431ada7c97d6b11480517fb9 Mon Sep 17 00:00:00 2001 From: Dane Williams Date: Fri, 29 May 2020 16:52:23 -0700 Subject: [PATCH 3/3] set default weather.txt --- data/weather.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/weather.txt b/data/weather.txt index 2aee588..da28569 100644 --- a/data/weather.txt +++ b/data/weather.txt @@ -1 +1 @@ -☀ 78° Pleasanton, CA +Loading...