From 462c624b4a9617741c535f170654ae53f89abcf6 Mon Sep 17 00:00:00 2001 From: Daniel Tsvetkov Date: Mon, 9 Oct 2017 11:04:34 +0300 Subject: [PATCH] Initial commit --- .gitignore | 1 + apod.sh | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 .gitignore create mode 100755 apod.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c6e766 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +image.jpg diff --git a/apod.sh b/apod.sh new file mode 100755 index 0000000..ca2eaf0 --- /dev/null +++ b/apod.sh @@ -0,0 +1,5 @@ +#!/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"