Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA249      CA318      CA425      CA651

w2mind.computing.dcu.ie      w2mind.org


How to set up an active desktop in 6 lines of Shell

This is my favourite Shell script or batch file ever. It illustrates perfectly the advantages of having a programmable system.

When I was doing my postgrad work in the UK around 1995 I used to run this little Shell script to turn my desktop background into a live view of Dublin, that would run all day long.

The sun would slowly rise and set in my background, as I worked away in the foreground:



 url="http://images.ireland.com/webcam/liveview.jpg"
 file=dublin.jpg

 while true
 do
  lynx -reload -source $url > $file
  xv -root -quit -max $file
  sleep 1200
 done


Notes



O'Connell Bridge, Dublin, right now.
From Dublin City Council.




A version that should work on DCU Linux now

 
	url="http://www.dublincity.ie/dublintraffic/Site0Camera6.jpg"

 file=$HOME/background.jpg

 while true
 do
  wget -q -O - $url  > $file
  
  gconftool-2   -t str   -s /desktop/gnome/background/picture_filename   $file
  gconftool-2   -t str   -s /desktop/gnome/background/picture_options    "stretched"     

  # sleep for this no. of seconds
  # 1200 = 20 mins

  sleep 1200
 done


Notes


Usage



Feeds      HumphrysFamilyTree.com

Bookmark and Share           On Internet since 1987.