first commit

This commit is contained in:
Andros Fenollosa 2017-02-17 10:27:39 +01:00
commit c7633529bc
2 changed files with 15 additions and 0 deletions

1
README.md Normal file
View File

@ -0,0 +1 @@
# bitbar-unsplash-autobackground

14
background-unsplash-auto.1h.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
# <bitbar.title>AutoBackground Unsplash</bitbar.title>
# <bitbar.version>v1.o</bitbar.version>
# <bitbar.author>Andros Fenollosa</bitbar.author>
# <bitbar.author.github>tanrax</bitbar.author.github>
# <bitbar.desc>Autochange the wallpaper with an unsplash image</bitbar.desc>
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