#!/bin/sh # # $Id: map 3189 2006-06-07 16:00:06Z swright $ # # Code to download the latest satellite weather map from the BOM and # put it as my background. # # - Written by Stewart V. Wright, 1999-2003. # # http://stewartvwright.googlepages.com # - Available under the GNU Public Licence and all that... WGET=wget BGDIR=${HOME}/Backgrounds BASENAME=AusMap URL="http://www.bom.gov.au/gms/" PAGE="IDE00005.latest.shtml" # # This exists because I have a text log-in and start my X-Server # manually. I have the following alias set: # alias s='if [ ! ${DISPLAY} ]; then \ # (map --sleep 15 &); \ # startx 2> ${HOME}/.Xsession-errors; exec true; fi' # which means this script sits around until X has started before # running. if [ $# -gt 0 ]; then if [ "${1}" == "--sleep" ]; then if [ -z "${2}" ]; then sleeptime=10 else sleeptime=${2} fi sleep ${sleeptime} fi fi # # Find image... WEBCMD="${WGET} -q -O- ${URL}${PAGE}" IMG=`${WEBCMD} | grep 'img src="IDE' | cut -d '"' -f2` # What file type is it? IMGBASE=`echo ${IMG} | sed 's/.*\.//'` # # Get image... IMGNAME=${BGDIR}/${BASENAME}.${IMGBASE} ${WGET} -q -O ${IMGNAME} ${URL}${IMG} # # Make the image the background in Gnome # # Thanks to Ansgar M. Schmidt for this info... # http://www.pluriverse.de/ansi/Howtos/bgimage.html gconftool-2 \ -t string \ -s /desktop/gnome/background/picture_filename ${IMGNAME} # If you use something like FVWM try this... #xv -root -max -quit $TMPIMAGE$IMAGE ## END