Skip to content

Instantly share code, notes, and snippets.

@miao1007
Last active April 3, 2016 17:36
Show Gist options
  • Save miao1007/54a2bdb012c643e9f826 to your computer and use it in GitHub Desktop.
Save miao1007/54a2bdb012c643e9f826 to your computer and use it in GitHub Desktop.
download himawari8 wallpaper for mac
#!/bin/sh
#delay 30 minute
delay=-v-30M
#image location
location=$HOME/Pictures/himawari8
date=$(date -u $delay "+%Y/%m/%d")
file_name=$(date -u $delay "+%H")$(echo "($(date -u $delay "+%M"))/10 * 10" | bc)"00_0_0.png"
url=http://himawari8-dl.nict.go.jp/himawari8/img/D531106/1d/550/$date/$file_name
mkdir -p $location
cd $location
#Override download
curl $url > $file_name
img_path=$location/$file_name
osascript <<EOF
tell application "Finder" to set desktop picture to POSIX file "$img_path"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment