Skip to main content

xcontroller

xcontroller is a Python library for developing X11 automation scripts. It includes functionality for controlling the window manager, the keyboard, and the mouse.

It is based on the following projects:

pyewmh by Julien Pagès: The functionality for controlling the window manager and windows, like getting the desktop size or setting the active window, are taken from this project. The code has only been refactored to follow Python style naming and some type hints were modified.

pynput by Moses Palmér: The keyboard and mouse controllers were adapted from this project. A lot of the capabilities of pynput have been left out, most importantly support for Windows and MacOS, listeners, and thread safety. Type hints have been improved.

python-xvfb by Jonathan Ultis: The function for starting an Xvfb server was taken from this project with only some minor modifications.

Usage examples

  • get the desktop geometry

    from xcontroller.ewmh import WMController
    
    wm = WMController()
    width, height = wm.get_desktop_geometry()
    
  • find a shell window and raise it

    from xcontroller.ewmh import WMController
    
    wmc = WMController()
    for window in wmc.get_client_list():
        if "Shell" in window.get_wm_name():
            window.raise_window()
    
  • press and release keys on the keyboard

    from xcontroller.keyboard import KeyboardController, SpecialKey
    
    kc = KeyboardController()
    
    kc.tap("x")
    
    kc.press(SpecialKey.ENTER)
    kc.release(SpecialKey.ENTER)
    
    with kc.pressed(SpecialKey.CTRL):
        kc.tap("s")
    
  • move the mouse pointer and click the right button

    from xcontroller.mouse import MouseController, Button
    
    mc = MouseController()
    
    mc.move(800, 500)
    mc.click(Button.RIGHT)
    
  • start an 1920x1080x24 Xvfb server on display 42

    from xcontroller.xvfb import start_xvfb
    
    process = start_xvfb(42, 1920, 1080, 24)
    

Metadata

Release files for xcontroller 0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xcontroller 0.2
File Size Uploaded Provenance Actions
xcontroller-0.2.tar.gz 45.5 kB Without provenance Details for xcontroller-0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for xcontroller 0.2
File Interpreter ABI Platform Actions
xcontroller-0.2-py3-none-any.whl Python 3 none any Details for xcontroller-0.2-py3-none-any.whl

Total release size: 96.7 kB

Release files / xcontroller-0.2.tar.gz

Download URL xcontroller-0.2.tar.gz
Size 45.5 kB
Tags Source
SHA-256 checksum
How to use checksums
ae974b59c561c5aadbdc8b0d0c7762e75b54b139dff085960f6e2a46eb0d92ab
BLAKE2b-256 checksum
How to use checksums
405d051fc569593ec6aae2dbed337494f283a5ffc566bd480380a09575c9f06b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / xcontroller-0.2-py3-none-any.whl

Download URL xcontroller-0.2-py3-none-any.whl
Size 51.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6673552b2e8fd16af3e97d8fc49d073b7c559b2563dfab888c63f37bd607f61a
BLAKE2b-256 checksum
How to use checksums
f573aca0b9c6b92ca5e0ca4b029a2871b48668868343f13b1741810f79f0c4bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.6 {"installer":{"name":"uv","version":"0.11.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"25.10","id":"questing","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for xcontroller 0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page