From time to time, I like some picture so much that I "go through all the trouble" (a 5-clicks process) and save it as my wallpaper.
I wanted something automated to do this (i.e. save the POD as my wallpaper). I know there is Opal (both for Windows & Linux), but I don't want to use it for two reasons:
- when I last tested it, it failed to work (i.e. it did not set any wallpaper)
- I fail to see the purpose of running a program full time (even if it's using almost none CPU & memory) just to update a file one time a day
#!/bin/bash
# the URL of the photo feed
RSS_FEED=http://www.nationalgeographic.com/rss/photography/photo-of-the-day
# the prefix of the photos URL (used to find the newest photo)
IMAGE_URL_PREFIX=http://photography.nationalgeographic.com/staticfiles/
# format of the photo
# in = 270x179, sw = 800x600, lw = 1024x768, xl=1280x1024
IMAGE_FORMAT=sw
# directory where to save the images
IMAGE_DIRECTORY=~/Pictures
# retrieve the RSS feed, grep for the latest image and
# replace it's name to match the required format
IMAGE_URL=`wget -qO /dev/stdout $RSS_FEED | egrep -m 1 -o "$IMAGE_URL_PREFIX[^\"]*" | sed -e s/-in\.jpg\$/-$IMAGE_FORMAT\.jpg/`
# retrive the image
wget -q -nc -P $IMAGE_DIRECTORY $IMAGE_URL
# get the image file name
IMAGE_FILE=`basename $IMAGE_URL`
# set the image as background
gconftool -s -t string /desktop/gnome/background/picture_filename $IMAGE_DIRECTORY/$IMAGE_FILE
gconftool -s -t string /desktop/gnome/background/picture_options scaled
This comment has been removed by a blog administrator.
ReplyDeletejackgessner is a spammer (posting links to adult websites).
ReplyDelete