Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Search:

CA216      CA249      CA318

CA400      CA651      CA668


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

This is my favourite Shell script. It illustrates the advantages of having a programmable system.

The first webcams came out in the mid 1990s when I was doing my postgrad in England.
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





Pearse St, Dublin, right now.
From Dublin City Council.




Usage




To set background image in GNOME 3

To set background image in GNOME 3:
   
 gsettings set org.gnome.desktop.background picture-uri "file://$file"

Notes:



Old: To set background image in GNOME 2

To set background image in GNOME 2:
   
  gconftool-2   -t str   -s /desktop/gnome/background/picture_filename   $file
  gconftool-2   -t str   -s /desktop/gnome/background/picture_options    "stretched"     

Notes:


Feeds      w2mind.org

On Internet since 1987.