From c7633529bc0e05ec384bb2457cca41d866fbfbbd Mon Sep 17 00:00:00 2001 From: Andros Fenollosa Date: Fri, 17 Feb 2017 10:27:39 +0100 Subject: [PATCH] first commit --- README.md | 1 + background-unsplash-auto.1h.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 README.md create mode 100755 background-unsplash-auto.1h.sh diff --git a/README.md b/README.md new file mode 100644 index 0000000..fe2676a --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# bitbar-unsplash-autobackground diff --git a/background-unsplash-auto.1h.sh b/background-unsplash-auto.1h.sh new file mode 100755 index 0000000..e2a4e1a --- /dev/null +++ b/background-unsplash-auto.1h.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +# AutoBackground Unsplash +# v1.o +# Andros Fenollosa +# tanrax +# Autochange the wallpaper with an unsplash image +echo '🖼' +echo '---' +echo 'Update | refresh=true' +curl --silent "http://www.google.es" +if [ $? -eq 0 ]; then + curl --silent -L -o /Users/$USER/Pictures/background.jpg "https://source.unsplash.com/random" + defaults write com.apple.desktop Background "{default = {ImageFilePath='/Users/$USER/Pictures/background.jpg'; };}"; killall Dock +fi