This is a small project I wrote because I got tired of my wallpapers way too fast.
This way I utilize the Konachan API to fetch random wallpapers and automatically apply them.
This was written with Windows 10 and Ubuntu 20.04 in mind.
So this might not run on your OS or OS version.
To install the required packages you can simply run:
python -m pip install -r requirements.txtThe requirements.txt file has all the required dependencies predefined
To build this into a single executable I use PyInstaller.
And execute the following command:
pyinstaller main.pyw --name "WallpaperRoulette" --icon "./icons/icon.ico" --onefileThe download folder and the config file are stored in a folder inside your user directory.
Windows: %USERPROFILE%/Wallpaper Roulette
Ubuntu: ~/Wallpaper Roulette
This script automatically creates a config.json file with configurations that can be changed.
{
"searchTags": String[],
"width": String,
"height": String,
"rating": String,
"removeOld": Boolean
}Above you see the config file with the corresponding types
searchTags is a string array, that means it only takes an array of strings.
This script will pick a random item from the array each time it runs.
Tags can be found on this page tags.
width and height are the dimensions you wish to search for.
This script will search on the exact dimensions you enter.
Defaults: "width": "1920", "height": "1080"
The rating is a string with the rating of the images.
To find more information on the ratings visit ratings
As of this moment the ratings are as follows:
"safe"- Safe"questionable"- Questionable (ecchi)"explicit"- Explicit (hentai)"questionableless"- Safe & Questionable"questionableplus"- Questionable & Explicit
By default this script removes all the downloaded wallpapers when a new one is set.
If you would like this script to preserve the downloads, set this to false.
This feature can save up bandwidth if the wallpaper was used before,
so it doesn't have to download the same one twice.
- Offline mode
When no connection can be detected or the API is offline.
It will use previous downloaded wallpapers.