Skip to content

bvbxbv/independent-wallpapers

Repository files navigation

Independent wallpapers

JavaScript Node.js pnpm License

Tool for automatically fetching wallpapers from wallhaven.cc and setting them as your desktop background.

Installation

  1. Clone repository
git clone https://github.com/bvbxbv/independent-wallpapers
  1. Install dependencies
cd independent-wallpapers
pnpm install # or npm i
  1. Create file .env in project directory with:

SAVE_DIRECTORY path may be relative or absolute.

API_KEY=<YOUR API KEY>
SAVE_DIRECTORY=./wallpapers/
DEBUG_MODE=false

NOTE: Make sure the SAVE_DIRECTORY folder exists.

Features

  • you can specify what exactly wallpapers you need in queries.yaml
  • automatically download image and set it as background

Usage

Manual

# Let's assume that you are already in the project directory
node main.js

Automatic (with cron)

  1. Creating and preparing script
# create script to run this app
touch indie-wallpapers.sh
chmod +x indie-wallpapers.sh

Put this inside the script:

#!/bin/bash
cd /path/to/independent-wallpapers/
node main.js
  1. Cron
crontab -e

Example: run every 30 minutes

# it's means cron will run your script every 30 minutes
*/30 * * * * /path/to/script/indie-wallpapers.sh 2>&1

Example: 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>&1

Don't like cron? Me too

If 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
done

Compatibility

I think it's cross platform. You can test it

Tested with:

  • Pop os 22.04
  • node 24.11.1

License

MIT — use it however you want.

About

Automatically fetch wallpapers from wallhaven.cc and set them as your desktop background

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published