From 5ec15075f982d238ccaa4df8f6f59128ab429f61 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Wed, 13 Dec 2017 16:45:44 +0200 Subject: [PATCH] set default --- apod.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apod.sh b/apod.sh index ca2eaf0..ee48c98 100755 --- a/apod.sh +++ b/apod.sh @@ -1,5 +1,9 @@ #!/bin/bash NASA_APOD_BASE_URL="https://apod.nasa.gov/apod" IMAGE_URL=`curl -s $NASA_APOD_BASE_URL/astropix.html | grep -oh 'href="image/.*"' | grep -oh 'image/.*jpg' | head -1` -curl -s "$NASA_APOD_BASE_URL/$IMAGE_URL" > image.jpg -gsettings set org.gnome.desktop.background picture-uri "file:///$(pwd)/image.jpg" +if [ ! -z "$IMAGE_URL" ]; then + curl -s "$NASA_APOD_BASE_URL/$IMAGE_URL" > image.jpg + gsettings set org.gnome.desktop.background picture-uri "file:///home/pi2/Pictures/wallpapers/blue_galaxy_wallpaper.png" +else + gsettings set org.gnome.desktop.background picture-uri "file:///$(pwd)/image.jpg" +fi