How to set up an active desktop in 6 lines of Shell
Here is a Shell script I wrote in the 1990s
when
the first webcams
came out.
I was then outside Ireland, doing my postgrad in England.
I wrote this script
to turn my desktop background into a live webcam 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.
This
illustrates the advantages of having a programmable
system.
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
- This was the Irish Times webcam
(on their old domain
ireland.com).
The domain is sold
and the webcam is
gone.
-
lynx
is a command line browser.
It can be used to make HTTP requests from scripts.
- xv
is obsolete.
This was used to set background image on X-windows systems.
The command to do this in general depends on what GUI you are using.
DCU Linux uses the GNOME GUI.
- sleep
means sleep for this number of seconds
(1200 = 20 mins)
- What happens if no "sleep" command?
- I say "6 lines of Shell" because it would be if you scrap the first 2 lines and
hard-code the url and file.
- macOS
introduced
Dynamic Desktop
in 2018.
Set of images which are the same scene with different lighting for different times of day and night.
OS changes image as day goes on.
Live webcam view of
Aberdeen, Scotland.
From
Aberdeen City Council.
Usage
- launch it in background:
activedesktop &
- to find it:
ps with options
- to stop it: kill PID
- or log off
To set background image in GNOME 3:
gsettings set org.gnome.desktop.background picture-uri "file://$file"
Notes:
- $file
needs to be the absolute path of the file.
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:
|