Skip to content

KarloFunke/spanpaper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spanpaper

Create wallpapers that span perfectly across multiple monitors with different resolutions, scaling settings, and physical sizes.

Online Version

You can use spanpaper directly in your browser on karl-funke.com/spanpaper if you dont want to run it locally. The online Version does the same exact thing, it uses this code slightly adapted to work with my api.

Example on my Setup

Original Image:

Original wallpaper

Transformed by spanpaper:

Transformed output

Applied on my setup (I Need to buy monitors with matching colors...):

Setup result

Example image from Jonny Gios on Unsplash.

Important Compatibility Note

This tool currently supports Linux Systems using GNOME on X11 only (Ubuntu's default for example).
It will probably not work with Wayland or on Windows or on Mac.

Requirements

  • Linux system with GNOME on X11 (not Wayland)
  • Python 3
  • Pillow library

Setup

  1. Download the create_wallpaper.py script or clone the repo.

  2. Install the required library:

    pip install pillow
  3. Open the script in a text editor.

  4. Configure your monitor layout at the top of the file:

    • Enter resolution, scaling, physical size (in inches), aspect ratio, and optional vertical offset.
    • Define the gaps (in inches) between monitors.
    • Optionally add your xrandr output if monitors are not bottom-aligned.

Configuration Guide

Configure monitors from LEFT to RIGHT:

Monitor Settings

  • Resolution: Your monitor's resolution. Choose a preset or enter pixels manually.
  • Scaling Factor: The scaling factor you set in system settings (e.g., 100% = 1.0, 150% = 1.5).
  • Size (inches): The physical size of your monitor in inches (diagonal measurement).
  • Aspect Width and Height: The aspect ratio of your monitor (e.g., 16 and 9 for a 16:9 display).
  • Bottom Offset: The physical offset to the lowest monitor in inches. Set the lowest monitor to 0, and others to how much higher their bottoms are.
  • Gap after monitor: The size of the gap between this monitor and the next one in inches.

xrandr Output (Optional)

Use this field only if your monitors are not bottom-aligned in your system settings.

Bottom-aligned: You don't need xrandr output

Monitors bottom-aligned

Not bottom-aligned: You need xrandr output

Monitors not bottom-aligned

If you need it: Open your terminal, run the following command, and paste the entire output into the xrandr_output variable in the script:

xrandr

The system will automatically calculate the pixel offsets needed to align your wallpaper correctly.

Usage

Run the script with your input image and specify an output path:

python3 create_wallpaper.py input_image.jpg output_path.png

The script accepts common image formats (PNG, JPEG, JPG, WEBP, GIF, AVIF) and will generate a PNG file that spans perfectly across your configured monitors.

Applying the Wallpaper

You need GNOME Tweaks

If you don't have GNOME Tweaks installed, install it using your package manager:

sudo apt install gnome-tweaks     # For Ubuntu/Debian
sudo dnf install gnome-tweaks     # For Fedora
sudo pacman -S gnome-tweaks       # For Arch Linux

To apply the wallpaper:

  1. Open GNOME Tweaks
  2. Go to Appearance > Background
  3. Set the image to the generated wallpaper
  4. Set Adjustment to Spanned

License

Do whatever you want with it. See LICENSE file for details.

About

A Python script that slices and scales a wallpaper image to span seamlessly across multiple monitors with different sizes, resolutions, and scaling factors. Ideal for Linux users who want a perfectly-aligned wallpaper on a multi-monitor setup.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages