Skip to main content

x11util Package

x11util - Wrapper fucntions to make X11 low-level Xlib programming easier

DESCRIPTION

This manual page documents x11util module, a Python module providing several wrapper function for Xlib programming easier.

EXAMPLE

import time
from Xlib import X, display
from x11util import create_window, create_gcs, load_font, draw_str, flush

disp = display.Display()
font = load_font(disp)
screen = disp.screen()
window = create_window(disp, screen, width=320, height=240, x=100, y=200)
gcs = create_gcs(disp, screen, window, font)
draw_str(disp, screen, window, gcs, 'Hello, World!', 10, 20)
draw_str(disp, screen, window, gcs, 'Hello, World!', 11, 21, level=50)
flush(disp, screen)
time.sleep(10)

FUNCTIONS

x11util module provides the following functions.

  • create_window(disp, screen, width=640, height=480, x=0, y=0, override=1, mask=X.ExposureMask)

    Create a new window on screen SCREEN in display DISP with given WIDTH and HEIGHT, which is placed at the geometry of (X, Y) using Xlib's XCreateWindow. override_redirect and event_mask can specified by OVERRIDE and MASK, respectively.

  • load_font(disp, font=None)

    Load bitmap font FONT in display DISP, and return the loaded font object. If font loading failed, return None.

  • create_gcs(disp, screen, window, font)

    Create GCs (Graphics Content) on screen SCREEN in display DISP for window WINDOW with font FONT. GCs are returned as a dictionary, whose key is the color name (e.g., 'SteelBlue') and the value is a dictionary, whose items are (LEVEL, GC), where LEVEL is a brightness between 0 and 100 and GC is the GC for that brightness.

  • clear(window)

    Erase the window WINDOW.

  • draw_str(disp, screen, window, gcs, astr, col=0, row=0, color='PaleGreen', level=100, reverse=False)

    Render a string ASTR on window WINDOW on screen SCREEN in display DISP using graphics contents GC. Text color and brightness can be specified by COLOR and LEVEL, respectively. Reverse video is enabled if REVERSE is True.

  • flush(disp, screen)

    Flush all pending X11 requests.

CUSTOMIZATION

On startup, x11util module loads per-user RC script (~/.x11utilrc) if it exists. The RC script is any valid Python script. You can change the behavior of x11util using the RC file.

An example ~/.x11utilrc file is as follows.

global FONT_NAME
FONT_NAME = '-hiro-fixed-medium-r-normal--8-80-75-75-c-80-iso646.1991-irv'

INSTALLATION

pip3 install x11util

AVAILABILITY

The latest version of x11util module is available at PyPI (https://pypi.org/project/x11util/) .

SEE ALSO

AUTHOR

Hiroyuki Ohsaki <code[atmark]lsnl.jp>

Metadata

Release files for x11util 1.4

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

Source distribution (sdist)

Source distribution for x11util 1.4
File Size Uploaded Provenance
x11util-1.4.tar.gz 16.6 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 33.8 kB

Release files / x11util-1.4.tar.gz

Download URL x11util-1.4.tar.gz
Size 16.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2f0302f30f776dfc9409bb01149661ffc4893300be7fad8307d05a5b50eb257c
BLAKE2b-256 checksum
How to use checksums
5d8d2b266f055451daf3071d271facc0f48c3e6b9d5b87446d830dd5ffc41ad4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / x11util-1.4-py3-none-any.whl

Download URL x11util-1.4-py3-none-any.whl
Size 17.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd2f27f77801a212afbb1dbe66a46cbb7f18f2da31696771f9cccc7e9d7fe9dc
BLAKE2b-256 checksum
How to use checksums
863079b0b3a90dcf125ea4a3276a5b302cb4aa231f312fe4b2f28486d1c090a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Security for x11util 1.4

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.

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