diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36570c9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +data/weather.txt diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/data/weather.txt b/data/weather.txt deleted file mode 100644 index da28569..0000000 --- a/data/weather.txt +++ /dev/null @@ -1 +0,0 @@ -Loading... diff --git a/scripts/dracula.sh b/scripts/dracula.sh index bf9c146..f3adc12 100755 --- a/scripts/dracula.sh +++ b/scripts/dracula.sh @@ -104,6 +104,11 @@ main() # status bar tmux set-option -g status-style "bg=${gray},fg=${white}" + # wait unit data/weather.txt exists just to avoid errors + # this should almost never need to wait unless something unexpected occurs + while [ ! -f $current_dir/../data/weather.txt ]; do + sleep 0.01 + done # Powerline Configuration if $show_powerline; then diff --git a/scripts/sleep_weather.sh b/scripts/sleep_weather.sh index c3de174..d42adb0 100755 --- a/scripts/sleep_weather.sh +++ b/scripts/sleep_weather.sh @@ -19,6 +19,10 @@ main() current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + if [ ! -f $current_dir/../data/weather.txt ]; then + printf "Loading..." > $current_dir/../data/weather.txt + fi + $current_dir/weather.sh > $current_dir/../data/weather.txt while tmux has-session &> /dev/null