From b087727b7044760ad854800d9bff4903c2d0e4af Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Tue, 3 Apr 2018 15:47:18 +0200 Subject: [PATCH] Put file names into vars --- wallspla.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/wallspla.sh b/wallspla.sh index 85a7dbe..ccb9a71 100755 --- a/wallspla.sh +++ b/wallspla.sh @@ -7,6 +7,12 @@ ACCESS_KEY="" #Comma separated collection ids: https://unsplash.com/collections COLLECTIONS="" +#Name of the jpg file to use +WALLPAPER_LOCATION=~/Images/wallpaper.jpg + +#Name of the info (txt) file +INFO_LOCATION=~/Images/wallpaper.txt + #Get new random info photo=$(curl -sf -H "Accept-Version: v1" -H "Authorization: Client-ID ${ACCESS_KEY}" "https://api.unsplash.com/photos/random?featured&orientation=landscape&collections=${COLLECTIONS}&random=${RANDOM}") photo_url=$(echo ${photo} | jq -r ".urls.full") @@ -14,12 +20,12 @@ photo_location=$(echo ${photo} | jq -r ".location.title") photo_username=$(echo ${photo} | jq -r ".user.name") #Download it -curl -Lsf -o ~/Images/wallpaper.jpg ${photo_url} +curl -Lsf -o ${WALLPAPER_LOCATION} ${photo_url} #Set as wallpaper -nitrogen --save --set-zoom ~/Images/wallpaper.jpg +nitrogen --save --set-zoom ${WALLPAPER_LOCATION} #Put wallpaper info into text file (eg for Conky) -echo "Taken in ${photo_location} by ${photo_username}" > ~/Images/wallpaper.txt +echo "Taken in ${photo_location} by ${photo_username}" > ${INFO_LOCATION} # vim:set ts=2 sw=2 et: