#!/bin/bash # # setrootwx.sh - Kevin P. Inscoe (kevin@inscoe.org) # # You must first set the control panel in CDE to "no background" # if using this script in Solaris. Takes various radar screens for # Central Florida and updates the background. I run this as cron # every 5 minutes during daytime hours. # # Requires Lynx, XV and the Netpbm tools installed if using Solaris. # Look at Sunfreeware.com # # Otherwise under Linux use xloadimage # # For a complete listing of radar sites consult http://inscoe.org/wx # # Updates: # # April 2, 2003 # # Recently this script has been moved to my Redhat 8 desktop but should still # work on a Solaris desktop. It previously worked under Solaris 8 # DISPLAY=localhost:0; export DISPLAY # # Now durng Hurricane Season switch off between local radar and storm track # min=`date "+%M"` echo "Minute: $min" GFX="http://radar.wunderground.com/data/nids/MLB19_0.gif" HFX1="http://www.nhc.noaa.gov/ftp/graphics/AT02/refresh/AL0204W+GIF/031508W.gif" HFX2="http://www.nhc.noaa.gov/ftp/graphics/AT02/refresh/AL0204W+GIF/031508W.gif" HFX3="http://www.nhc.noaa.gov/ftp/graphics/AT02/refresh/AL0204W+GIF/031508W.gif" TPC="http://kevininscoe.com/nhctpc/" #if [ $(($min%2)) -eq 0 ]; then # GFX="http://radar.wunderground.com/data/nids/MLB19_0.gif" #else # GFX="http://www.nhc.noaa.gov/ftp/graphics/AT02/refresh/AL0203W+GIF/110858W.gif" # GFX="http://kevininscoe.com/nhctpc/" #fi # Get the last digit of minute digit="x" digit=`echo $min | cut -c2` if [ "$digit" = "x" ]; then digit=$min fi echo "Digit: $digit" case "$digit" in "0" ) GFX=$HFX1 ;; "1" ) GFX=$TPC ;; "2" ) GFX=$HFX2 ;; "3" ) GFX=$TPC ;; "4" ) GFX=$HFX3 ;; "5" ) GFX=$TPC ;; "6" ) GFX=$HFX1 ;; "7" ) GFX=$TPC ;; "8" ) GFX=$HFX2 ;; "9" ) GFX=$TPC ;; esac /bin/date rm /tmp/mydesktop.fil /usr/bin/lynx -source $GFX > /tmp/mydesktop.fil if [ -e /tmp/mydesktop.fil ]; then /usr/bin/xv -quit -root -rmode 5 -maxpect -max +viewonly /tmp/mydesktop.fil fi