Automatically Changing Wallpaper

A few days ago, I stumbled upon some Firewatch wallpapers for the different times of day, and wanted to have the wallpaper on my mac automatically switch through them. However, all of the solutions I found for this were overly complex, or just plain didn't work on macOS Sierra. So, here's my solution that doesn't require installing anything and is pretty easy to set up.

First make a folder somewhere on your computer. I made the folder 'Wallpapers' in the '~/Documents' folder. Put in the images you want to cycle between. Then, create a file called change.sh. In it, paste the code found at the following url: http://pastebin.com/tQR1rNs1. Save it in the same folder you just put the images in. Now you need to modify the script to choose the names of the images. Replace 'Sunrise.jpg', 'Day.jpg', etc. with the names of the images. You can also adjust the times the images change between by adjusting the values in the if statement.

Now you need to make sure that the script actually runs and changes the wallpaper. For this, you'll need Terminal. Open Terminal, and navigate to the folder you created. Add run permissions to the 'change.sh' file by running the command chmod +x change.sh. Now typing ./change.sh should change the wallpaper to the correct wallpaper for the current time.

Finally, we need to make it do this automatically. For this, we're going to use crontab. With Terminal still open, type crontab -e to edit your crontab file (it probably won't have existed up to this point). Press 'i' to enter editing mode, and then paste the following line: */15 * * * * /Users/alexbeals/Documents/Wallpapers/change.sh, where the path is the path to the change.sh file you made. Then hit Escape, and then type ':q' and hit Enter to save the crontab. This will run the script ever 15 minutes, which should accurately update your wallpaper. Enjoy!