NASA IOTD Wallpaper

Credits
Credits to: NASA Image of the day as Gnome background

Requirements
feh

run_once function (in your config): function run_once(prg) if not prg then do return nil end end awful.util.spawn_with_shell("pgrep -f -u $USER -x " .. prg .. " || (" .. prg .. ")") end

nasaBackground.sh:
 * 1) !/bin/bash
 * 1) grabs the nasa image of the day by RSS feed and updates the gnome
 * 2) background. add this to your cron jobs to have this happen daily.  this is,
 * 3) obviously, a hack, that is likely to break at the slightest change of NASA's
 * 4) RSS implementation. yay standards!

rss=`wget -q -O - http://www.nasa.gov/rss/lg_image_of_the_day.rss` img_url=`echo $rss | grep -o ']*>' | grep -o 'http://[^\"]*'` img_name=`echo $img_url | grep -o [^/]*\.\w*$` mkdir -p $HOME/.backgrounds wget -q -O $HOME/.backgrounds/$img_name $img_url feh --bg-scale $HOME/.backgrounds/$img_name
 * 1) EDITED FOR feh
 * 1) this command is benign if the directory already exists.
 * 1) this command will overwrite the image if it already exists

Install
Put the nasaBackground.sh script to anywhere in your ~/ folder. Mine's here: ~/scripts/nasaBackground.sh

Using the run_once function, simply sh the nasaBackground.sh script. run_once("sh /home/YOURUSERNAME/fooFolder/nasaBackground.sh")