From ba6412a5b9f5e5f3233613a28e2d2d953358dfd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Sat, 30 May 2020 11:32:28 -0300 Subject: [PATCH 1/5] Fix spacing when temperatures isn't available --- scripts/weather.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/weather.sh b/scripts/weather.sh index cef059b..985af91 100755 --- a/scripts/weather.sh +++ b/scripts/weather.sh @@ -58,7 +58,7 @@ forecast_unicode() display_weather() { if [ $country = 'US' ]; then - echo "$(forecast_unicode)$(get_temp)°" + echo "$(forecast_unicode)$(get_temp)° " else echo '' fi @@ -75,7 +75,7 @@ main() fi # process should be cancelled when session is killed if ping -q -c 1 -W 1 ipinfo.io &>/dev/null; then - echo "$(display_weather) $city, $(get_region_code)" + echo "$(display_weather)$city, $(get_region_code)" else echo "Location Unavailable" fi From 2607300bebf72b1f7483d33aa9d9f998ea8e531d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Sat, 30 May 2020 11:51:16 -0300 Subject: [PATCH 2/5] Fix spacing when battery percentage isn't available --- scripts/battery.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/battery.sh b/scripts/battery.sh index ee33bdc..25dc32b 100755 --- a/scripts/battery.sh +++ b/scripts/battery.sh @@ -35,7 +35,8 @@ battery_percent() # Check OS case $(uname -s) in Linux) - linux_acpi percent + percent=$(linux_acpi percent) + [ -n "$percent" ] && echo " $percent" ;; Darwin) @@ -74,7 +75,7 @@ battery_status() if [ $status = 'discharging' ] || [ $status = 'Discharging' ]; then echo '' else - echo 'AC ' + echo 'AC' fi } From 5ceaf612f2655b34d98c7e992080396c058bc874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Sat, 30 May 2020 12:09:14 -0300 Subject: [PATCH 3/5] Remove spaces after battery, network and weather status --- scripts/dracula.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 0685c77..851200c 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -83,17 +83,17 @@ main() powerbg=${gray} if $show_battery; then - tmux set-option -g status-right "#[fg=${pink},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${pink}] #($current_dir/battery.sh) " + 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 - tmux set-option -ga status-right "#[fg=${cyan},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh) " + 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 - 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 From 13ae1a009071f555e7a261f0edad1a9109edd7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Sat, 30 May 2020 12:13:42 -0300 Subject: [PATCH 4/5] Move space from network script to main script --- scripts/dracula.sh | 2 +- scripts/network.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 851200c..acd362e 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -88,7 +88,7 @@ main() fi if $show_network; then - tmux set-option -ga status-right "#[fg=${cyan},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${cyan}]#($current_dir/network.sh)" + 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 diff --git a/scripts/network.sh b/scripts/network.sh index 045445c..41a4cc1 100755 --- a/scripts/network.sh +++ b/scripts/network.sh @@ -42,7 +42,7 @@ main() fi done - echo " $network" + echo "$network" } #run main driver function From 54ebc1ac766accb9c04f5eec10658c5ecdb84387 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20Carvalho?= Date: Sat, 30 May 2020 19:15:48 -0300 Subject: [PATCH 5/5] Readd comments --- scripts/dracula.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/dracula.sh b/scripts/dracula.sh index 269d756..f5aad95 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -98,17 +98,17 @@ main() 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