Results 1 to 2 of 2

Thread: Fetch daily-updated online image as wallpaper

  1. #1
    Join Date
    Aug 2009

    Fetch daily-updated online image as wallpaper

    Hello all,
    just an itch I needed to scratch; there's an image on a website, and it is updated every day (happily using a regular format for its url). I want to fetch this image every day and set it as my desktop background. In my example, the image is the YouGov daily poll ratings for the UK, but I hope this will be helpful for others to adapt.

    mkdir $HOME/pollgrabber
    cd $HOME/pollgrabber
    date +%d --date="yesterday" > date
    echo > templateurl
    cat templateurl | sed "s/dategoeshere/`cat date`/" templateurl > url
    wget $( cat "./url" ) -O today.png
    gconftool-2 --type string --set /desktop/gnome/background/picture_filename "$HOME/pollgrabber/today.png"
    gconftool-2 --type string --set /desktop/gnome/background/picture_options centre
    A quick run-through:

    1. Make a directory for the script to run in, just makes things tidier. Don't worry about running this again, if the folder's already there it doesn't matter.
    2. Change to that directory
    3. Find yesterday's date, i.e. if yesterday was 21st October, a file will be created containing the text 21.
    4. This url will be set as the template for the date to be substituted into
    5. Substitute the "date" file into the template url
    6. Use wget (a downloading tool) to fetch the image
    7. Use gconftool to set the image as the wallpaper
    8. Use gconftool to centre the wallpaper (optional, but probably a good idea with medium-low res images like this one)

    Hope someone finds this useful.
    Attached Files Attached Files

  2. #2
    Join Date
    May 2007
    Ubuntu 9.10 Karmic Koala

    Arrow Re: Fetch daily-updated online image as wallpaper

    I had a similar itch to scratch.

    I use cron to set the frequency and the URL etc

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts