From 3f56abd9283b5942a2cb0e1ff3f9f7cea0ae494b Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 28 Oct 2019 20:36:51 -0400 Subject: [PATCH] Add aopd to changepaper script --- systemd/.config/systemd/user/astronomypotd.sh | 28 +++++++++++++++++++ systemd/.config/systemd/user/changepaper.sh | 23 +++++++++++++++ 2 files changed, 51 insertions(+) create mode 100755 systemd/.config/systemd/user/astronomypotd.sh diff --git a/systemd/.config/systemd/user/astronomypotd.sh b/systemd/.config/systemd/user/astronomypotd.sh new file mode 100755 index 0000000..06e3243 --- /dev/null +++ b/systemd/.config/systemd/user/astronomypotd.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# 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 +####################### + +#Change directory to where the script resides. +BASEDIR="$HOME/var/inbox/apod_photos" +cd $BASEDIR +####################### + +#getting the image URL +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 diff --git a/systemd/.config/systemd/user/changepaper.sh b/systemd/.config/systemd/user/changepaper.sh index 63119e8..71d4fdb 100755 --- a/systemd/.config/systemd/user/changepaper.sh +++ b/systemd/.config/systemd/user/changepaper.sh @@ -29,3 +29,26 @@ then 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 +####################### + +#getting the image URL +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