#!/bin/bash
# weather_maps_slideshow_0.0.1.sh

# 2007-01-11
# Mark W. Giles
# I took Duane's convert script and modified it to loop through 8 maps
# from weather.com. There is a five second delay between each map.

# urls for radars and maps
# southeast 1800 mile radar url
URL_SE_1800_RADAR=http://image.weather.com/web/radar/us_se_9regradar_plus_usen.jpg
# 600 mile radar url
URL_SE_INFRARED_SATELLITE00_RADAR=http://image.weather.com/web/radar/us_tlh_closeradar_plus_usen.jpg
# 300 mile radar url
URL_300_RADAR=http://image.weather.com/web/radar/us_pfn_ultraradar_plus_usen.jpg
# current weather map url
URL_CURRENT_WEATHER=http://image.weather.com/images/maps/current/cur_se_720x486.jpg
# southeast visible satellite url
URL_SE_VISIBLE_SATELLITE=http://image.weather.com/images/sat/regions/se_vis_sat_720x486.jpg
# southeast infrared satellite url
URL_SE_INFRARED_SATELLITE=http://image.weather.com/images/sat/regions/southeast_sat_720x486.jpg
 # current temperature map url
URL_CURRENT_TEMP=http://image.weather.com/images/maps/current/se_curtemp_720x486.jpg
# current dew point map url
URL_CURRENT_DEW=http://image.weather.com/images/maps/current/se_cur_dew_720x486.jpg

wget -q $URL_CURRENT_WEATHER -O pix_1.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((1 * 13))
wget -q $URL_SE_VISIBLE_SATELLITE -O pix_2.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((2 * 13))
wget -q $URL_SE_INFRARED_SATELLITE -O pix_3.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((3 * 13))
wget -q $URL_SE_1800_RADAR -O pix_4.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((4 * 13))
wget -q $URL_SE_INFRARED_SATELLITE00_RADAR -O pix_5.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((5 * 13))
wget -q $URL_300_RADAR -O pix_6.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((6 * 13))
wget -q $URL_CURRENT_TEMP -O pix_7.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((7 * 13))
wget -q $URL_CURRENT_DEW -O pix_8.jpg
osd_cat -b percentage -p top -A center -c green -l 1 -d 2 -P $((8 * 13))

# kill the progress bar
#killall osd_cat

# display pix with xview
#convert radar.jpg pclug.png -gravity SouthWest -composite jpg:- | xview stdin
xview -quiet -global -delay 5 pix_*.jpg -goto pix_1.jpg

# remove downloaded image files
rm pix_*.jpg

