commit c7633529bc0e05ec384bb2457cca41d866fbfbbd Author: Andros Fenollosa Date: Fri Feb 17 10:27:39 2017 +0100 first commit 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