Hello! I posted this in another thread, but I thought that it was a lot more applicable to this forum. The idea was to take the picture from this website, download it automatically every day, and set it to my wallpaper. I wrote a small shell script to do this, that I wanted to share. It's my first script, so I'd definitely like criticism and suggestions. I've got the script in a folder in my home folder called .wallpaper, and it runs every morning via a crontab entry. Let me know what you think!
Code:#!/bin/bash # download image from apod site wget -A.jpg -R.txt -r -l1 --no-parent -nH http://antwrp.gsfc.nasa.gov/apod/astropix.html # move image from obscure folder to main folder, rename image find ./apod -name "*.jpg" | while read line ; do mv "$line" "wallpaper.jpg" done # set image to wallpaper gconftool-2 -t string -s /desktop/gnome/background/picture_filename "blank.jpg" gconftool-2 -t string -s /desktop/gnome/background/picture_filename "/home/josh/.wallpaper/wallpaper.jpg" gconftool-2 -t string -s /desktop/gnome/background/picture_options "zoom"



Adv Reply





Bookmarks