A simple node script intended to download background wallpapers from either Unsplash or Inspiro Bot, and programmatically apply as desktop wallpaper (multiple monitors supported). MacOS Only.
-
Install Dependencies
$ yarn install
-
Configure Environment
- copy .env.example to .env
- (required for unsplash only) add your unsplash client ID to access the API (register for free at https://api.unsplash.com)
- optionally configure environment (.env) variables to your preference, or just use defaults
-
One-off execution 1.1. Fetch from Unsplash
$ yarn start
or$ yarn fetch:unsplash
1.2. Fetch from Inspiro$ yarn fetch:inspiro
-
Scheduled execution If you wish to have this script run periodically in the background, simply set a CRON job to run the provided "bg-splash.sh" at the desired interval e.g.
*/15 * * * * /path/to/this/dir/bg-splash.sh
or with logging:*/15 * * * * /path/to/this/dir/bg-splash.sh > /path/to/logs/bg-splash.log 2>&1
$ yarn lint
$ yarn test
If your environment requires you to run this script from root, you may need to specify the $HOME directory as follows:
e.g. */15 * * * * /path/to/this/dir/bg-splash.sh /path/to/your/home/dir