Created
July 9, 2012 02:51
-
-
Save kanru/3073933 to your computer and use it in GitHub Desktop.
Use NASA / NationalGeographic IOTD as background wallpaper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# grabs the nasa image of the day by RSS feed and updates the gnome | |
# background. add this to your cron jobs to have this happen daily. this is, | |
# obviously, a hack, that is likely to break at the slightest change of NASA's | |
# RSS implementation. yay standards! | |
#EDITED FOR feh | |
rss=`wget -q -O - http://www.nasa.gov/rss/lg_image_of_the_day.rss` | |
img_url=`echo $rss | grep -o '<enclosure [^>]*>' | grep -o 'http://[^\"]*'` | |
img_name=`echo $img_url | grep -o [^/]*\.\w*$` | |
# this command is benign if the directory already exists. | |
mkdir -p $HOME/.cache/backgrounds | |
# this command will overwrite the image if it already exists | |
wget -q -O $HOME/.cache/backgrounds/$img_name $img_url | |
feh --bg-fill $HOME/.cache/backgrounds/$img_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rss=`wget -q -O - http://photography.nationalgeographic.com/photography/photo-of-the-day/` | |
img_url=`echo $rss | grep -o '<div class="download_link"><a[^>]*>'| grep -o 'http://[^\"]*'` | |
img_name=`echo $img_url | grep -o [^/]*\.\w*$` | |
# this command is benign if the directory already exists. | |
mkdir -p $HOME/.cache/backgrounds | |
# this command will overwrite the image if it already exists | |
wget -q -O $HOME/.cache/backgrounds/$img_name $img_url | |
feh --bg-fill $HOME/.cache/backgrounds/$img_name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment