Tool for automatically fetching wallpapers from wallhaven.cc and setting them as your desktop background.
- Clone repository
git clone https://github.com/bvbxbv/independent-wallpapers- Install dependencies
cd independent-wallpapers
pnpm install # or npm i- Create file
.envin project directory with:
SAVE_DIRECTORYpath may be relative or absolute.
API_KEY=<YOUR API KEY>
SAVE_DIRECTORY=./wallpapers/
DEBUG_MODE=falseNOTE: Make sure the
SAVE_DIRECTORYfolder exists.
- you can specify what exactly wallpapers you need in
queries.yaml - automatically download image and set it as background
# Let's assume that you are already in the project directory
node main.js- Creating and preparing script
# create script to run this app
touch indie-wallpapers.sh
chmod +x indie-wallpapers.shPut this inside the script:
#!/bin/bash
cd /path/to/independent-wallpapers/
node main.js- Cron
crontab -eExample: run every 30 minutes
# it's means cron will run your script every 30 minutes
*/30 * * * * /path/to/script/indie-wallpapers.sh 2>&1Example: run every 30 minutes (but with logs)
# make sure the DEBUG_MODE in .env is true
*/30 * * * * /path/to/directory/indie-wallpapers.sh >> /path/to/logs/log.txt 2>&1If you don’t want to deal with cron at all (and i totally understand you)
#!/bin/bash
while true; do
./indie-wallpapers.sh
sleep 60
doneI think it's cross platform. You can test it
Tested with:
- Pop os 22.04
- node 24.11.1
MIT — use it however you want.