tmux-kanagawa/sleep_weather.sh
2020-03-15 10:32:59 -07:00

20 lines
477 B
Bash
Executable file

#/usr/bin/env bash
#wrapper script for running weather on interval
main()
{
echo "Loading Weather..." > ~/.tmux/plugins/tmux-dracula/weather.txt
while tmux has-session &> /dev/null
do
./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt
if [ (cat ~/.tmux/plugins/tmux-dracula/weather.txt | sed -n 2p) =~ ' "error": {' ]; then
echo "Too Many Requests" > ~/.tmux/plugins/tmux-dracula/weather.txt
break
fi
sleep 1000
done
}
#run main driver function
main