You are not logged in.
Not sure where to put this, I found a script on t'internet for downloading today's APOD and setting it as the gnome background. I then modified it to:
a) fix it to work with gif images as well as jpgs.
b) add xfce4 compatibility
c) get a random image instead of todays image
#!/bin/bash
#Filename: apodwallpaper
#Location: ${HOME}/.bin
#Purposes: Downloads NASA Astronomy Picture of the Day and displays it as the
# GNOME background
#Author(s): acvwJosh of Ubuntu Forums, modified by Colin Dean <http://cad.cx>
## Modified by deicist of ARCH linux forums: added xfce4 support, added .gif support, added random support
## requires athena-jot package from AUR
##random stuff goes here
##start date is a cutoff year to get images after. I use this because most pre-2000 images are too small to make good desktops
STARTDATE="2000";
NOW=$(date +%Y);
randYear=$(jot -r 1 $STARTDATE $NOW);
randMonth=$(jot -r 1 01 12);
randDay=$(jot -r 1 01 28);
getDate=$(date -d $randYear/$randMonth/$randDay +%y%m%d);
#change this if you want the image to be in a different directory
FILENAME=apodwallpaper
APODWALLPAPER=${HOME}/.${FILENAME}
#remove directory if it exists
rm -rf ${APODWALLPAPER}
mkdir -p ${APODWALLPAPER} && cd ${APODWALLPAPER}
# download image from apod site
wget -A.gif -A.jpg -R.txt -r -l1 --no-parent -nH http://apod.nasa.gov/apod/ap$getDate.html
# move image from obscure folder to main folder, rename image
find ./apod -name "*.gif" -or -name "*.jpg" | while read line ; do
mv "$line" "${FILENAME}.jpg"
done
#######uncomment next 3 lines for gnome
#gconftool-2 -t string -s /desktop/gnome/background/picture_filename "blank.jpg"
#gconftool-2 -t string -s /desktop/gnome/background/picture_filename "${APODWALLPAPER}/${FILENAME}.jpg"
#gconftool-2 -t string -s /desktop/gnome/background/picture_options "zoom"
######uncomment next line for xfce4 -primary display
#xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s ""
#xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-path -s "${APODWALLPAPER}/${FILENAME}.jpg"
#xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor0/image-style -s 3
#uncomment next line for xfce4 -secondary display
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor1/image-path -s ""
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor1/image-path -s "${APODWALLPAPER}/${FILENAME}.jpg"
xfconf-query -c xfce4-desktop -p /backdrop/screen0/monitor1/image-style -s 3
# Uncomment ONE of the following for use with feh (thanks to SkonesMickLoud)
#feh --bg-tile "${APODWALLPAPER}/${FILENAME}.jpg"
#feh --bg-center "${APODWALLPAPER}/${FILENAME}.jpg"
#feh --bg-scale "${APODWALLPAPER}/${FILENAME}.jpg"
#feh --bg-seamless "${APODWALLPAPER}/${FILENAME}.jpg"
#get rid of cruft
rm -rf apod robots.txt
Last edited by deicist (2009-03-26 22:29:14)
Offline
I think Community contributions would be more appropriate. Maybe create a PKGBUILD for AUR?
what goes up must come down
Offline
If you'd like to add it, the following works with feh:
# Uncomment ONE of the following for use with feh:
#feh --bg-tile "${APODWALLPAPER}/${FILENAME}.jpg"
#feh --bg-center "${APODWALLPAPER}/${FILENAME}.jpg"
#feh --bg-scale "${APODWALLPAPER}/${FILENAME}.jpg"
#feh --bg-seamless "${APODWALLPAPER}/${FILENAME}.jpg"
Also, line 26 should read rm -rf ${APODWALLPAPER} as ${APODWALLPAPER} is a dir, and most users would (probably) want to avoid confirming the removal of it every time.
I also get this error, even though everything seems to work:
./apodwallpaper.sh: line 15: jot: command not found
./apodwallpaper.sh: line 16: jot: command not found
./apodwallpaper.sh: line 17: jot: command not found
Jot isn't in the repos or AUR, is there an alternative?
Last edited by SkonesMickLoud (2009-03-26 17:39:51)
Offline
Cheers for the pointers
Jot is available in AUR, the package is called 'athena-jot' . The package build needs updating though, as per http://bbs.archlinux.org/viewtopic.php?id=68415
edit: okay, I reposted in community contributions.
Last edited by deicist (2009-03-26 19:10:56)
Offline
You should get the text too and output it with conky or something over the image.
Offline
You should get the text too and output it with conky or something over the image.
I was thinking abou this. Shouldn't be too hard with imagemagick or something similar, just not had time to look into it today.
Offline
Jot is available in AUR, the package is called 'athena-jot' . The package build needs updating though, as per http://bbs.archlinux.org/viewtopic.php?id=68415
Haa, so it is. I fail at reading!
Offline
added suggested improvements to original post.
Offline