set default

This commit is contained in:
Daniel Tsvetkov 2017-12-13 16:45:44 +02:00
parent 462c624b4a
commit 5ec15075f9

View File

@ -1,5 +1,9 @@
#!/bin/bash #!/bin/bash
NASA_APOD_BASE_URL="https://apod.nasa.gov/apod" 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` IMAGE_URL=`curl -s $NASA_APOD_BASE_URL/astropix.html | grep -oh 'href="image/.*"' | grep -oh 'image/.*jpg' | head -1`
if [ ! -z "$IMAGE_URL" ]; then
curl -s "$NASA_APOD_BASE_URL/$IMAGE_URL" > image.jpg 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" gsettings set org.gnome.desktop.background picture-uri "file:///$(pwd)/image.jpg"
fi