As a fan of the Firewatch game, I had an idea of an automatic wallpaper switcher that applies a wallpaper based on the time of the day.
- Find a set of your new wallpapers and add them to the
wallpapers
folder - Update your coordinates in
list.js
on lines 5 and 6 - Update the
list.js
with the desired order and slots. The start value is the minutes since midnight and you can usesunrise
andsunset
values to sync the change with the daylight. - Install all necessary libraries:
npm install
npm install -g forever
forever start ./scheduler.js
forever stop ./scheduler.js
Since macOS doesn't allow changing wallpapers on all spaces at once, there is a hack that needs to be applied after the script has been started the first time:
- Go to your Desktop & screensaver settings
- Add the wallpaper folder as one of the available folders
- For every desktop, select the
active.jpg
(last item) as your current wallpaper
All times are calculated on the start of the run, which means that sunrise and sunset values will go out of sync. This is good enough for v1 since the error will be negligible in the first few days, assuming you reboot your device every now and then.