| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 | #!/bin/sh# This Script downloads National Geographic Photo of the day, and sets it as desktop background (gnome, unity)# Copyright (C) 2012 Saman Barghi - All Rights Reserved# Permission to copy, modify, and distribute is granted under GPLv3# Last Revised 22 May 2019######################## For feh, we need display set properlyexport DISPLAY=:0.0export XAUTHORITY=/home/powellc/.Xauthorityif [ -n "$1" ]; then  SOURCE=$1else  SOURCE='astrobin'fi# Choices: astrobin,natgeo,nasa,unsplash,bingBASEDIR="$HOME/var/media/backgrounds/$SOURCE"SEARX_BASEDIR="$HOME/var/media/backgrounds/bing"# Get daily NatGeo POTDpython3 ~/.bin/get_natgeo_potd.pypython3 ~/.bin/get_astrobin_potd.pypython3 ~/.bin/get_unsplash_potd.pypython3 ~/.bin/get_bing_potd.pydate=$(date '+%Y-%m-%d')#set the current image as wallpaperecho "Setting desktop background"hsetroot -cover $BASEDIR/$date.jpg#link slim background to new imageSLIM_BG_FILE=/usr/share/slim/themes/default/background.jpgif test -f "$SLIM_BG_FILE"; then	echo "Setting Slim background image"	rm $SLIM_BG_FILE	ln -s $BASEDIR/$date.jpg $SLIM_BG_FILEfiSEARX_BG_FILE=/usr/local/lib/python2.7/site-packages/searx/static/themes/courgette/img/bg-body-index.jpgif test -f "$SEARX_BG_FILE"; then	echo "Setting Searx background image"	rm $SEARX_BG_FILE	cp $SEARX_BASEDIR$date.jpg $SEARX_BG_FILEfi# Then grab our APOD image and store it for now#Change directory to where the script resides.#BASEDIR="$HOME/var/inbox/apod_photos"#cd $BASEDIR########################### Get the APoD image from NASA#img="$(curl https://api.nasa.gov/planetary/apod\?api_key=AdfgdnmmInYgpDMEq3ShMLKjJ7DZ7jyUcgLHWdgw | jq .hdurl | tr -d \")"###check to see if there is any wallpaper to download#if [ -n "$img" ]#then#	img_file=`echo $img | cut -d/ -f 7 | tr -d \"`#	curl $img > $img_file#	#set the current image as wallpaper#	#hsetroot -sane $BASEDIR/$img_file#	##link slim background to new image#	#rm /usr/share/slim/themes/default/background.jpg#	#ln -s $BASEDIR/$img_file /usr/share/slim/themes/default/background.jpg#else#	echo "No Wallpaper today"#fi
 |