Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

Online coding site: Ancient Brain

Free course: Online AI programming exercises


CA114      CA170

CA668      CA669      Projects

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:


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


Live webcam view of Aberdeen, Scotland.
From Aberdeen City Council.


To set background image in GNOME 3

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


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"     


ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.

Wikipedia: Sometimes I link to Wikipedia. I have written something In defence of Wikipedia. It is often a useful starting point but you cannot trust it. Linking to it is like linking to a Google search. A starting point, not a destination. I automatically highlight in red all links to Wikipedia and Google search and other possibly-unreliable user-generated content.