RSS feed as wallpaper
10 Feb 2010
Pre-Req
convert utility :sudo apt-get install imagemagick
curl utility :sudo apt-get install curl
Any wallpaper : it's called rss.jpg here
The idea is pretty native :
Step 1 : Get the rss feed URL
Step 2 : Scrap for the data
Step 3 : Set the data as wallpaper
Code template
#!/bin/bash
convert -font helvetica -fill white -pointsize 36 -draw \
'text 500,500 "This is the data from the rss feed"' \
rss.jpg rss-current.jpg
while [ 1 ]; do
COUNTER=0
while [ $COUNTER -lt 10 ]; do
# grep for text as per your requiremnet
text=`curl -s $URL | grep CDATA`
cmd="convert -font helvetica -fill white -pointsize 40 -draw 'text 500,500 \"$text\"' rss.jpg rss-current.jpg"
eval $cmd
temp=$(stat -c%s black-current.jpg)
if [[ $temp > 1000 ]]
then
eval $cmd
break
fi
sleep 5
let COUNTER=COUNTER+1
done
sleep 3
done
Now just run the coe as background process :
$ ./rss.sh &
You will find a new image called rss-current.jpg in the same path as your script, set it as a wallpaper and stay updated.
RSS