Wallpaper Management
Config-Sway provides a flexible wallpaper system with both automatic theme-based wallpapers and manual wallpaper selection. Wallpapers are managed using swaybg, a Wayland-native background manager.
Quick Start
Press Super+W to open the wallpaper switcher and select from available wallpapers.
Wallpaper System Overview
Config-Sway uses a three-tier wallpaper system:
- Saved wallpaper: Path stored in
~/.config/sway/wallpaper
- Fallback wallpaper:
~/.config/wallpapers/arch-linux-logo.webp
- Solid color:
#1e1e2e (dark background)
The system automatically uses the first available option in this order.
Wallpaper Directory Structure
Using the Wallpaper Switcher
Interactive Selection
The wallpaper switcher (~/.config/rofi/scripts/wallpaper-switcher.sh) provides a visual menu:
The wallpaper switcher displays thumbnail previews in Rofi, making it easy to identify wallpapers before applying them.
How It Works
- Scans wallpapers: Reads all image files from
~/.config/wallpapers/
- Displays menu: Shows wallpapers with icon previews in Rofi
- Saves selection: Writes chosen wallpaper path to
~/.config/sway/wallpaper
- Applies wallpaper: Kills existing
swaybg process and starts new one
- Sends notification: Displays notification with wallpaper thumbnail
Automatic Wallpaper Loading
The setwallpaper.sh script runs automatically on Sway startup:
Wallpaper Selection Logic
From ~/.config/scripts/setwallpaper.sh:3-18:
The script automatically kills any existing swaybg instances before applying the new wallpaper, preventing multiple background processes.
Adding Custom Wallpapers
Method 1: Using Wallpaper Directory
- Copy your wallpaper to the wallpapers directory:
- Open the wallpaper switcher with
Super+W and select your wallpaper.
Method 2: Command Line
Set a wallpaper directly from the command line:
Config-Sway supports these image formats for wallpapers:
- JPEG (
.jpg, .jpeg)
- PNG (
.png)
- WebP (
.webp)
Avoid using extremely high-resolution wallpapers (>4K) as they may impact system performance, especially on systems with limited RAM or older GPUs.
swaybg Display Modes
The wallpaper system uses swaybg -m fill by default, but you can use other modes:
Changing Display Mode
Edit ~/.config/scripts/setwallpaper.sh:9 to change the mode:
Theme-Based Wallpapers
When you switch themes using Super+A, the theme’s wallpaper is automatically applied:
The theme switcher:
- Looks for
wallpaper.(jpg|png|webp) in the theme directory
- Saves the path to
~/.config/sway/wallpaper
- Applies it with
swaybg -i <path> -m fill
You can customize a theme’s wallpaper by replacing its wallpaper.* file with your preferred image, keeping the same filename and extension.
Multi-Monitor Setup
For multi-monitor setups, swaybg applies the same wallpaper to all displays by default. To set different wallpapers per output:
Method 1: Multiple swaybg Instances
Method 2: Advanced Configuration
Create a custom wallpaper script:
Then modify ~/.config/sway/config:154 to use your custom script:
Find your output names with: swaymsg -t get_outputs | grep name
Wallpaper Script Integration
The wallpaper system integrates with other Config-Sway components:
Theme Switcher Integration
From ~/.config/rofi/scripts/theme-switcher.sh:154-173:
Sway Reload Behavior
The setwallpaper.sh script uses exec_always, meaning it runs:
- On Sway startup
- Every time you reload Sway config (
Super+Shift+R or swaymsg reload)
This ensures your wallpaper persists across configuration reloads.
Troubleshooting
Wallpaper Not Changing
Check saved wallpaper path:
Verify file exists:
Manually apply wallpaper:
Multiple swaybg Processes
If you see multiple swaybg processes consuming resources:
Wallpaper Not Fitting Properly
Try different display modes:
Wallpaper Disappears After Login
Ensure the wallpaper path in ~/.config/sway/wallpaper is absolute, not relative:
Permission Denied
Check file permissions:
Advanced Usage
Dynamic Wallpaper Rotation
Create a script to rotate wallpapers automatically:
Schedule with a timer or cron:
Wallpaper with Time-Based Selection
Replace setwallpaper.sh with your custom script in ~/.config/sway/config:154 to enable dynamic wallpaper features.