A shell script which helps to change mac desktop background image.
codeskyblue opened this issue · 3 comments
It will be interesting to update the desktop image time by time. This is a script I write for my mac.
#!/bin/bash -
#
# For mac update desktop image
set -eu
MINUTE=$(date +%M)
MINUTE=$(printf "%02d" $(expr $MINUTE - $(expr $MINUTE % 10)))
FILENAME="$HOME/Pictures/earth-images/earth-$(date +%Y%m%d-%H)$MINUTE.jpg"
mkdir -p "$(dirname $FILENAME)"
if ! test -f "$FILENAME"
then
echo "Save image to $FILENAME"
himawari -o $FILENAME -z 2
fi
echo "Change background image"
osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$FILENAME\""
Check out this great script by @ngoldman. He has contributed graciously to this project and has solve this. Maybe you can open an issue there to see if you can set a "frequency" option to update your BG at regular intervals. I would actually like that myself!
@jakiestfu cool. may you should write it in readme.
😁 I'm working on a mac menubar
app that will do just what you're describing (basically himawari-bg
as a continuous background process being executed at a given frequency). I believe the Himawari 8 images are updated every 10 minutes, so I'm planning on making that the default, and maybe allowing the user to change frequency, resolution, bands (visible light or infrared) or even go back in time.