slideshow: picture frame + desktop

Alan BRASLAU alan.braslau at cea.fr
Fri Oct 3 11:39:44 CEST 2008


Hello plasma developers,

I am pleased to report how I am currently using
the slideshow feature of the picture frame applet
(also desktop background) to display updated
graphical information. Here, I continuously monitor
the traffic congestion in the Paris region,
(such a MacOS dashboard widget exists)
but one could use a similar scheme to
monitor information from other sources
including webcam images, etc.

To do so, I run a shell script using cron
that periodically updates images in a directory
that is then asynchronously displayed
on my plasma desktop.

This solution may seem obvious; maybe
a much more clever solution exits, or
perhaps this may give further ideas for
widget use...

Alan

crontab:

MAILTO=""
*/2 * * * * $HOME/sytadin/update

shell script:

#! /bin/sh
#
# Grab images from http://www.sytadin.fr/
# depends on: wget, imagemagick (convert)
#
cd $HOME/sytadin

# protect against multiple instances
if [[ -r pid && -d /proc/`cat pid` ]]; then
        exit 0
fi
echo $$ > pid

if [ ! -d merge ] ; then
        mkdir merge
fi

# zones of interest
for i in Paris_BP Paris_A86 SO_N118_A86_A6_A106 IDF ;
do
        # get (unchanging) background images, if missing
        if [ ! -r fond_$i.jpg ] ; then
                wget -q http://www.sytadin.fr/fonds/fond_$i.jpg
        fi
        # update (foreground) overlays
        wget -N -q http://www.sytadin.fr/raster/segment_$i.gif 
http://www.sytadin.fr/raster/arc_$i.gif
        # overlay traffic congestion maps
        if [ segment_$i.gif -nt merge/segment_$i.jpg ] ; then
                convert fond_$i.jpg segment_$i.gif -layers merge 
merge/segment_$i.jpg
        fi
        # overlay average speed maps
        if [ arc_$i.gif -nt merge/arc_$i.jpg ] ; then
                convert fond_$i.jpg arc_$i.gif -layers merge merge/arc_$i.jpg
        fi
done



More information about the Plasma-devel mailing list