mcol.xyz
A tiny standalone Python wallpaper setter for the X Window System, written initally as a Qtile plugin.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
mcol 44c2a984c1 add script, update setup.py and readme accordingly 7 months ago
qpaper add script, update setup.py and readme accordingly 7 months ago
.gitignore add script, update setup.py and readme accordingly 7 months ago
readme.rst add script, update setup.py and readme accordingly 7 months ago
setup.py add script, update setup.py and readme accordingly 7 months ago

readme.rst

qpaper

Python wallpaper-setter for X11.

This was originally written as an extension for the Qtile window manager (hence the name qpaper), though it works for X11 in general. It requires the same dependencies as Qtile, i.e. cairocffi and xcffib.

Usage

The qpaper.Painter acts as the wallpaper setting interface. Instantiate it with the name of the target display, and then either all screens can be painter by using the Painter.paint_all method, or an individual screen using the Painter.paint_screen method. These two methods can both take optional these keyword args:

  • image (str) : path to image to set as wallpaper
  • colour (str) : hex code to simply set a colour instead of an image
  • option (str) : one of 'fill' or 'stretch'

Painter.paint_screen should also be passed an int to index the target screen.

Script

Installation via setup.py also installs a script named qpaper that can be used directly:

qpaper /path/to/wallpaper/image.png --option fill

Example

To set wallpapers for all screens upon Qtile startup, add something like this to the Qtile config:

import os
import qpaper
from libqtile import hook

@hook.subscribe.startup
def startup():
    qpaper.Painter(os.environ.get("DISPLAY")).paint_all(
        image='/home/user/wallpaper.png', option='fill',
    )