From 2efc9be21fe44cb1b7bdef86f665a2737977f9dc Mon Sep 17 00:00:00 2001 From: Cedric Girard Date: Tue, 3 Apr 2018 15:59:29 +0200 Subject: [PATCH] allow to override settings with env vars --- wallspla.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wallspla.sh b/wallspla.sh index ccb9a71..5ff6920 100755 --- a/wallspla.sh +++ b/wallspla.sh @@ -2,16 +2,16 @@ set -euo pipefail #Unsplash API access key: https://unsplash.com/oauth/applications -ACCESS_KEY="" +: ${ACCESS_KEY:=""} #Comma separated collection ids: https://unsplash.com/collections -COLLECTIONS="" +: ${COLLECTIONS:=""} #Name of the jpg file to use -WALLPAPER_LOCATION=~/Images/wallpaper.jpg +: ${WALLPAPER_LOCATION:=~/Images/wallpaper.jpg} #Name of the info (txt) file -INFO_LOCATION=~/Images/wallpaper.txt +: ${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}")