From 9c9cde3e44b523fdcd36ad13d51c593f3567402c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Wed, 27 May 2020 02:43:13 -0300 Subject: [PATCH 1/8] Add option to enable high contrast on pane borders --- INSTALL.md | 1 + scripts/dracula.sh | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index c261f76..8165ece 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,3 +23,4 @@ Customize the status bar by adding any of these lines to your .tmux.conf as desi * Switch powerline symbols `set -g @dracula-show-left-sep ` for left and `set -g @dracula-show-right-sep ` for right symbol (can set any symbol you like as seperator) * Enable military time: `set -g @dracula-military-time true` * Switch the left smiley icon `set -g @dracula-show-left-icon session` it can accept `session`, `smiley`, or any character. +* Enable high contrast pane border: `set -g @dracula-border-contrast true` diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 0685c77..a607471 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -25,6 +25,7 @@ main() show_military=$(get_tmux_option "@dracula-military-time" false) 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' @@ -67,7 +68,12 @@ main() tmux set-option -g status-right-length 100 # pane border styling - tmux set-option -g pane-active-border-style "fg=${dark_purple}" + if $show_border_contrast; then + tmux set-option -g pane-active-border-style "fg=${light_purple}" + else + tmux set-option -g pane-active-border-style "fg=${dark_purple}" + fi + tmux set-option -g pane-border-style "fg=${gray}" # message styling From 131bcdae108e804aba89092faaa2e3fb7938aa88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Wed, 27 May 2020 15:24:30 -0300 Subject: [PATCH 2/8] Improve wireless detection when interface is down --- scripts/network.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/network.sh b/scripts/network.sh index 045445c..fdfda04 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -7,8 +7,9 @@ get_ssid() # Check OS case $(uname -s) in Linux) - if iw dev | grep ssid | cut -d ' ' -f 2 &> /dev/null; then - echo "$(iw dev | grep ssid | cut -d ' ' -f 2)" + SSID=$(iw dev | sed -nr 's/^\t\tssid (.*)/\1/p') + if [ -n "$SSID" ]; then + echo -- "$SSID" else echo 'Ethernet' fi From ec2739e9ba83ef4deedf9312994a62190cf301cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Wed, 27 May 2020 15:37:26 -0300 Subject: [PATCH 3/8] Use of "printf" command to avoid shell interpretation of dashes ("-") or percent sign ("%") --- scripts/network.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/network.sh b/scripts/network.sh index fdfda04..6ec84ad 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -9,7 +9,7 @@ get_ssid() Linux) SSID=$(iw dev | sed -nr 's/^\t\tssid (.*)/\1/p') if [ -n "$SSID" ]; then - echo -- "$SSID" + printf '%s' "$SSID" else echo 'Ethernet' fi From 0c4558d2061559610dbcde5cfacee4148857580f Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Thu, 28 May 2020 22:44:22 -0400 Subject: [PATCH 4/8] added option for window and fixed session --- scripts/dracula.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index a607471..424c756 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -43,7 +43,7 @@ main() smiley) left_icon="☺ ";; session) - left_icon="#W ";; + left_icon="#S ";; *) left_icon=$show_left_icon;; esac From d0412b13ada074903410121a5c5027be2c9bc587 Mon Sep 17 00:00:00 2001 From: Ethan Edwards Date: Thu, 28 May 2020 22:46:23 -0400 Subject: [PATCH 5/8] forgot to add dracula file and did the INSTALL.md file --- INSTALL.md | 2 +- scripts/dracula.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 8165ece..aa4fdd3 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -22,5 +22,5 @@ Customize the status bar by adding any of these lines to your .tmux.conf as desi * Enable powerline symbols: `set -g @dracula-show-powerline true` * Switch powerline symbols `set -g @dracula-show-left-sep ` for left and `set -g @dracula-show-right-sep ` for right symbol (can set any symbol you like as seperator) * Enable military time: `set -g @dracula-military-time true` -* Switch the left smiley icon `set -g @dracula-show-left-icon session` it can accept `session`, `smiley`, or any character. +* Switch the left smiley icon `set -g @dracula-show-left-icon session` it can accept `session`, `smiley`, `window`, or any character. * Enable high contrast pane border: `set -g @dracula-border-contrast true` diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 424c756..9ecd9c5 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -44,6 +44,8 @@ main() left_icon="☺ ";; session) left_icon="#S ";; + window) + left_icon="#W ";; *) left_icon=$show_left_icon;; esac From 6b18fd2d23628c676070f13ff7c630b6680594c3 Mon Sep 17 00:00:00 2001 From: Dane Williams Date: Fri, 29 May 2020 16:42:18 -0700 Subject: [PATCH 6/8] 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 7/8] 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 8/8] 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...