Skip to content

Commit dbdc65d

Browse files
Merge pull request #107 from markcornick/datafile_correction
Correct location of weather data file
2 parents 8748783 + a84b579 commit dbdc65d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/dracula.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ get_tmux_option() {
1515

1616
main()
1717
{
18+
datafile=/tmp/.dracula-tmux-data
19+
1820
# set current directory variable
1921
current_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2022

@@ -130,9 +132,9 @@ main()
130132
# status bar
131133
tmux set-option -g status-style "bg=${gray},fg=${white}"
132134

133-
# wait unit data/weather.txt exists just to avoid errors
135+
# wait unit $datafile exists just to avoid errors
134136
# this should almost never need to wait unless something unexpected occurs
135-
while $show_weather && [ ! -f $current_dir/../data/weather.txt ]; do
137+
while $show_weather && [ ! -f $datafile ]; do
136138
sleep 0.01
137139
done
138140

@@ -175,7 +177,7 @@ main()
175177
fi
176178

177179
if $show_weather; then # weather
178-
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)"
180+
tmux set-option -ga status-right "#[fg=${orange},bg=${powerbg},nobold,nounderscore,noitalics] ${right_sep}#[fg=${dark_gray},bg=${orange}] #(cat $datafile)"
179181
powerbg=${orange}
180182
fi
181183

@@ -224,7 +226,7 @@ main()
224226
fi
225227

226228
if $show_weather; then # weather
227-
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $current_dir/../data/weather.txt) "
229+
tmux set-option -ga status-right "#[fg=${dark_gray},bg=${orange}] #(cat $datafile) "
228230
fi
229231

230232
if $show_time; then

0 commit comments

Comments
 (0)