Merge pull request #107 from markcornick/datafile_correction

Correct location of weather data file
This commit is contained in:
Ethan Edwards 2021-06-30 19:56:53 -04:00 committed by GitHub
commit dbdc65d22b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,8 @@ get_tmux_option() {
main() main()
{ {
datafile=/tmp/.dracula-tmux-data
# set current directory variable # set current directory variable
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
@ -130,9 +132,9 @@ main()
# status bar # status bar
tmux set-option -g status-style "bg=${gray},fg=${white}" tmux set-option -g status-style "bg=${gray},fg=${white}"
# wait unit data/weather.txt exists just to avoid errors # wait unit $datafile exists just to avoid errors
# this should almost never need to wait unless something unexpected occurs # this should almost never need to wait unless something unexpected occurs
while $show_weather && [ ! -f $current_dir/../data/weather.txt ]; do while $show_weather && [ ! -f $datafile ]; do
sleep 0.01 sleep 0.01
done done
@ -175,7 +177,7 @@ main()
fi fi
if $show_weather; then # weather 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)" tmux set-option -ga status-right "#[fg=${orange},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${orange}] #(cat $datafile)"
powerbg=${orange} powerbg=${orange}
fi fi
@ -224,7 +226,7 @@ main()
fi fi
if $show_weather; then # weather if $show_weather; then # weather
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 $datafile) "
fi fi
if $show_time; then if $show_time; then