tmux-kanagawa/sleep_weather.sh

21 lines
477 B
Bash
Raw Normal View History

#/usr/bin/env bash
#wrapper script for running weather on interval
main()
{
2020-03-15 18:32:59 +01:00
echo "Loading Weather..." > ~/.tmux/plugins/tmux-dracula/weather.txt
while tmux has-session &> /dev/null
do
2020-03-15 06:30:21 +01:00
./weather.sh > ~/.tmux/plugins/tmux-dracula/weather.txt
2020-03-15 18:32:59 +01:00
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