1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #!/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 properly
- export DISPLAY=:0.0
- export XAUTHORITY=/home/powellc/.Xauthority
- # Get daily Astrobin PotD
- BASEDIR="$HOME/var/inbox/astrobin/"
- python3 ~/.bin/get_astrobin_potd.py
- date=$(date '+%Y-%m-%d')
- #set the current image as wallpaper
- feh --bg-scale $BASEDIR/$date.jpg
- #link slim background to new image
- rm /usr/share/slim/themes/default/background.jpg
- ln -s $BASEDIR/$date.jpg /usr/share/slim/themes/default/background.jpg
- echo "Background and slim wallpaper set using Astrobin PotD"
- ####### OLD Picture fetching for NatGeo and NASA APoD
- #######
- #Change directory to where the script resides.
- #BASEDIR="$HOME/var/inbox/ng_photos"
- #cd $BASEDIR
- #######################
- #getting the image URL
- #img="$(curl https://www.nationalgeographic.com/photography/photo-of-the-day/ -s | grep -oP '(?<="twitter:image:src" content=")\K[^"]*')"
- #
- ## Check to see if there is any wallpaper to download
- #if [ -n "$img" ]
- #then
- # img_base=`echo $img | cut -d/ -f 5`
- # img_md5=`echo -n $img_base | md5sum | cut -f1 -d" "`
- # img_file="$img_md5.jpg"
- #
- # curl "$img" > $img_file
- # #set the current image as wallpaper
- # #feh --bg-scale $BASEDIR/$img_md5.jpg
- # ##link slim background to new image
- # #rm /usr/share/slim/themes/default/background.jpg
- # #ln -s $BASEDIR/$img_md5.jpg /usr/share/slim/themes/default/background.jpg
- #else
- # echo "No Wallpaper today"
- #fi
- # 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
- # #feh --bg-scale $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
|