A cross-platform CLI tool that sets random wallpapers from configurable subreddits.
WARNING: This is vibe coded and not properly tested and reviewed.
- 🎨 Fetch wallpapers from multiple subreddits
- 🖼️ GUI application with live preview and configuration
- 📏 Filter by minimum resolution
- 🔄 Configurable post sorting (hot, top, new, etc.)
- 💾 Local image caching
- 🖥️ Cross-platform support (macOS, Windows, Linux)
- 🪟 Window manager support (i3wm, sway, hyprland, GNOME, KDE, XFCE, MATE, Cinnamon)
- 🚀 Automatic dependency management via wrapper script
- 📦 Isolated virtual environment handling
For users who want ready-to-use applications without installing Python:
- Go to the Releases page
- Download the latest
WallpaperRandomizer-Windows-*.zipfile - Extract the ZIP to a folder of your choice
- Run
WallpaperRandomizer.exe - The app will auto-create a config file at:
%APPDATA%\WallpaperRandomizer\config.yaml- To access: Press Win+R, type
%APPDATA%\WallpaperRandomizer, press Enter
- Edit the config file to add your Reddit API credentials
- Restart the app
The executable includes everything you need - no Python installation required!
See INSTRUCTIONS-Windows.txt (included in the ZIP) for detailed setup guide.
- Go to the Releases page
- Download the latest
WallpaperRandomizer-macOS-*.dmgfile - Open the DMG and drag
WallpaperRandomizer.appto Applications (or any folder) - First run: Right-click the app → "Open" → Click "Open" (bypasses Gatekeeper)
- The app will auto-create a config file at:
~/Library/Application Support/WallpaperRandomizer/config.yaml- To access: Finder → Cmd+Shift+G → Enter path above
- Edit the config file to add your Reddit API credentials
- Restart the app
The app bundle includes everything you need - no Python installation required!
Note: The app is unsigned, so macOS will show a security warning on first launch. This is normal for free, open-source apps.
See INSTRUCTIONS-macOS.txt (included in the DMG) for detailed setup guide.
For developers who want to build from source or use the CLI, continue to the Quick Start section below.
See BUILD.md for details on how these applications are built and distributed.
- Clone the repository:
git clone <repository-url>
cd wallpaper-randomizer-
Set up Reddit API credentials:
- Go to https://www.reddit.com/prefs/apps
- Click "Create App" or "Create Another App"
- Select "script" as the app type
- Fill in the form (name, redirect uri can be http://localhost:8080)
- Copy the client_id (under the app name) and client_secret
-
Initialize configuration:
python run.py initThis will create a config.yaml file. Edit it to add your Reddit credentials and preferences.
- Set a random wallpaper:
python run.py setThat's it! The wrapper script automatically:
- Creates a virtual environment (
.venv/) on first run - Installs all required dependencies
- Executes the wallpaper randomizer
The run.py wrapper script handles all virtual environment management automatically. You don't need to manually activate anything.
Set a random wallpaper:
python run.py setSet wallpaper with specific fill mode:
python run.py set --fill-mode zoom
python run.py set --fill-mode fill
python run.py set --fill-mode centerClear cached images:
python run.py clear-cacheTest configuration:
python run.py test-configView help:
python run.py --helpLaunch the graphical interface:
python run.py guiThe GUI provides an intuitive interface with:
- Live Configuration Editor: Edit all settings with instant auto-save
- Add/remove subreddits dynamically
- Adjust minimum resolution
- Configure post filters (sort, time, limit)
- Update Reddit API credentials
- Manage cache settings
- Wallpaper Preview: See wallpapers before setting them
- Image preview with aspect-ratio scaling
- Display title, subreddit, and resolution
- One-Click Operations:
- "Get Random Wallpaper" - Fetches and previews a new wallpaper
- "Set as Wallpaper" - Applies the previewed wallpaper
- Real-time Status: See progress and results in the status log
- Dark Theme: Easy on the eyes for extended use
- Background Processing: Non-blocking operations keep the UI responsive
The GUI automatically saves all configuration changes to config.yaml as you edit.
Update all dependencies to latest versions:
python run.py --updateRecreate virtual environment from scratch:
python run.py --recreate-venvSince the wrapper script uses absolute paths, you can call it from any directory:
# From anywhere on your system
python /path/to/wallpaper-randomizer/run.py setFor even easier access, you can create a shell alias:
Linux/macOS (add to ~/.bashrc or ~/.zshrc):
alias wallpaper='python /path/to/wallpaper-randomizer/run.py'Windows (PowerShell profile):
function wallpaper { python C:\path\to\wallpaper-randomizer\run.py $args }Then use it simply as:
wallpaper set
wallpaper clear-cacheA virtual environment is an isolated Python environment that keeps project dependencies separate from your system Python installation. This prevents conflicts between different projects that might need different versions of the same package.
The run.py wrapper script automatically manages a virtual environment for you:
- Location:
.venv/directory in the repository root - Automatic Creation: Created on first run if it doesn't exist
- Dependency Installation: All packages from
requirements.txtare installed automatically - No Manual Activation Needed: The wrapper handles activation internally
wallpaper-randomizer/
├── .venv/ # Virtual environment (auto-created, git-ignored)
│ ├── bin/ # Linux/macOS executables
│ ├── Scripts/ # Windows executables
│ ├── lib/ # Installed packages
│ └── ...
├── run.py # Wrapper script
├── requirements.txt # Python dependencies
└── ...
While the wrapper handles everything automatically, you can manually access the virtual environment if needed:
Activate manually (Linux/macOS):
source .venv/bin/activate
python -m wallpaper_randomizer set
deactivate # when doneActivate manually (Windows):
.venv\Scripts\activate
python -m wallpaper_randomizer set
deactivateHowever, using run.py is recommended as it's simpler and works identically on all platforms.
Edit config.yaml to customize behavior:
subreddits:
- wallpaper
- wallpapers
- EarthPorn
min_resolution:
width: 1920
height: 1080
post_filter:
sort: "top" # Options: hot, new, top, controversial, rising
time_filter: "month" # Options: hour, day, week, month, year, all
limit: 100 # Number of posts to fetch
reddit:
client_id: "your_client_id"
client_secret: "your_client_secret"
user_agent: "wallpaper-randomizer/1.0"
cache_dir: "~/.wallpaper-randomizer/cache"
max_cache_size_mb: 500See config.yaml.template for a complete example with all available options.
The wallpaper randomizer automatically detects and supports the following:
Desktop Environments:
- GNOME (uses
gsettings) - KDE Plasma (uses
plasma-apply-wallpaperimageorqdbus) - XFCE (uses
xfconf-query) - MATE (uses
gsettings) - Cinnamon (uses
gsettings)
Window Managers:
- i3wm (X11) - Requires one of:
feh,nitrogen, orxwallpaper - sway (Wayland) - Requires:
swaybg(recommended) orswayimg - hyprland (Wayland) - Requires:
hyprpaper(recommended) orswaybg
For i3wm users:
# Arch Linux
sudo pacman -S feh
# Ubuntu/Debian
sudo apt install feh
# Fedora
sudo dnf install fehFor sway users:
# Arch Linux
sudo pacman -S swaybg
# Ubuntu/Debian
sudo apt install swaybg
# Fedora
sudo dnf install swaybgFor hyprland users:
# Arch Linux
sudo pacman -S hyprpaper
# Or use swaybg as fallback
sudo pacman -S swaybgBy default, the tool tries available wallpaper tools automatically. If you want to force a specific tool, add this to your config.yaml:
# Optional: Override wallpaper tool
wallpaper_tool:
tool: "feh" # For i3: feh, nitrogen, xwallpaper
# For sway: swaybg, swayimg
# For hyprland: hyprpaper, swaybgThis is useful if you have multiple tools installed and prefer one over the others.
Add to crontab to change wallpaper every hour:
# Edit crontab
crontab -e
# Add this line (adjust path to your repository)
0 * * * * python /path/to/wallpaper-randomizer/run.py setExamples:
- Every hour:
0 * * * * - Every 30 minutes:
*/30 * * * * - Every day at 9 AM:
0 9 * * * - Every Monday at 8 AM:
0 8 * * 1
- Open Task Scheduler
- Create a new task
- Set trigger (e.g., daily at login, or every hour)
- Set action:
- Program:
python - Arguments:
C:\path\to\wallpaper-randomizer\run.py set - Start in:
C:\path\to\wallpaper-randomizer
- Program:
Create ~/Library/LaunchAgents/com.wallpaper-randomizer.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.wallpaper-randomizer</string>
<key>ProgramArguments</key>
<array>
<string>python3</string>
<string>/path/to/wallpaper-randomizer/run.py</string>
<string>set</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>Load it:
launchctl load ~/Library/LaunchAgents/com.wallpaper-randomizer.plistTry recreating the virtual environment:
python run.py --recreate-venvEnsure Python 3.7+ is installed and in your PATH:
python --version # or python3 --versionMake the wrapper executable:
chmod +x run.py
./run.py set # Then you can use ./run.py instead of python run.pyDelete .venv/ and let the wrapper recreate it:
rm -rf .venv
python run.py set # Will recreate venv automaticallywallpaper-randomizer/
├── run.py # Wrapper script (entry point)
├── requirements.txt # Python dependencies
├── config.yaml.template # Configuration template
├── wallpaper_randomizer/ # Main package
│ ├── __init__.py
│ ├── __main__.py # CLI entry point
│ ├── config.py # Configuration handling
│ ├── reddit_fetcher.py # Reddit API integration
│ ├── image_handler.py # Image processing
│ └── wallpaper_setter.py # Platform-specific wallpaper setting
├── .venv/ # Virtual environment (git-ignored)
└── README.md
python run.py test-config- Add package to
requirements.txt - Run
python run.py --updateto install new dependencies
MIT
Contributions are welcome! Please feel free to submit a Pull Request.