lys-lib

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT

README

lys-lib

The lys family's building blocks that are not widgets: what lys-ui draws with and what lys-shell talks to the system through.

  • Rendering: the 2D canvas and its CPU and Vulkan renderers.
  • GPU: Vulkan devices, exportable dmabufs, and H.264/H.265 encoding.
  • Media: MP4/Matroska muxing and the Opus encoder.
  • Wayland: screen capture, virtual input and the protocol bindings they use.
  • System services: the PipeWire native-protocol client and the EIS server.

Pure Go, CGO_ENABLED=0. Native libraries are dlopened at runtime only where the system provides the API: libvulkan.

Packages

Package What it is
render The 2D canvas: paths, text (with text), images, SVG, filters and blends, on the CPU
gpu Vulkan devices, the GPU renderer, exportable dmabufs, and H.264/H.265 encoding
dmabuf, dmabufwl, udmabuf dmabuf descriptions, their linux-dmabuf protocol plumbing, and memfd-backed udmabufs
capture Screen and window capture: wlr-screencopy, ext-image-copy-capture, Hyprland's toplevel export
vinput Virtual pointer and keyboard input (with keymapfd)
wlr Wayland protocol bindings beyond the core and xdg-shell
media/mux, media/opus MP4 and Matroska muxing, and the Opus encoder
debug The compile-time trace facility (build tag lysdebug, categories in LYS_DEBUG)
golden, gputest, wltest Test support: golden images, the GPU test driver, Wayland test clients

Development

nix develop (or direnv) enters the dev shell; just lists the recipes. just check runs the release gates, just gpu the GPU tests on lavapipe, just headless the capture and virtual input tests against a private headless sway, and just gpu-host every GPU path on the host's own GPU.

The packages moved here from lys-ui with their history; issue numbers in that history are lys-ui's.

Directories

Path Synopsis
Package capture copies screen contents out of the compositor: whole outputs and output regions through wlr-screencopy, single windows through ext-image-copy-capture (with the ext-foreign-toplevel-list enumeration and its capture sources) or Hyprland's toplevel-export, and continuous damage-driven output capture through an ext-image-copy-capture session (Stream).
Package capture copies screen contents out of the compositor: whole outputs and output regions through wlr-screencopy, single windows through ext-image-copy-capture (with the ext-foreign-toplevel-list enumeration and its capture sources) or Hyprland's toplevel-export, and continuous damage-driven output capture through an ext-image-copy-capture session (Stream).
Package debug is the lys family's compile-time trace facility.
Package debug is the lys family's compile-time trace facility.
Package dmabuf describes Linux dma-buf frames: GPU (or udmabuf) memory handed to the compositor by file descriptor through zwp_linux_dmabuf_v1, with no copy.
Package dmabuf describes Linux dma-buf frames: GPU (or udmabuf) memory handed to the compositor by file descriptor through zwp_linux_dmabuf_v1, with no copy.
Package dmabufwl builds zwp_linux_buffer_params_v1 objects from dmabuf descriptions, the step every linux-dmabuf import shares.
Package dmabufwl builds zwp_linux_buffer_params_v1 objects from dmabuf descriptions, the step every linux-dmabuf import shares.
Package golden compares rendered pixels against committed PNG snapshots ("goldens"), so render-level tests can assert byte-stable output on any machine.
Package golden compares rendered pixels against committed PNG snapshots ("goldens"), so render-level tests can assert byte-stable output on any machine.
Package gpu renders on the GPU through Vulkan, into memory shared with the compositor (or a display) as dmabufs: what a frame draws is handed over by file descriptor, with no copy.
Package gpu renders on the GPU through Vulkan, into memory shared with the compositor (or a display) as dmabufs: what a frame draws is handed over by file descriptor, with no copy.
Package gputest picks the Vulkan driver the GPU tests run on, from the environment: LYS_TEST_GPU=lavapipe runs them on Mesa's CPU driver (CI, no GPU needed), whose ICD file LYS_TEST_LAVAPIPE names (the dev shell sets it); any other value runs them on the host's device; unset, they run where a device is found and skip elsewhere.
Package gputest picks the Vulkan driver the GPU tests run on, from the environment: LYS_TEST_GPU=lavapipe runs them on Mesa's CPU driver (CI, no GPU needed), whose ICD file LYS_TEST_LAVAPIPE names (the dev shell sets it); any other value runs them on the host's device; unset, they run where a device is found and skip elsewhere.
Package keymapfd reads the xkb keymap a wl_keyboard.keymap event carries.
Package keymapfd reads the xkb keymap a wl_keyboard.keymap event carries.
media
mux
Package mux writes timestamped H.264, H.265 and Opus samples into fragmented MP4 (NewMP4) and Matroska (NewMKV) files, in pure Go.
Package mux writes timestamped H.264, H.265 and Opus samples into fragmented MP4 (NewMP4) and Matroska (NewMKV) files, in pure Go.
opus
Package opus is a pure-Go Opus encoder (RFC 6716) for lys-shell's recordings: CELT-only fullband 20 ms frames (configuration 31) at a constant or constrained variable bitrate, from lys-ui's media PCM layout (48 kHz, interleaved signed 16-bit samples, one or two channels).
Package opus is a pure-Go Opus encoder (RFC 6716) for lys-shell's recordings: CELT-only fullband 20 ms frames (configuration 31) at a constant or constrained variable bitrate, from lys-ui's media PCM layout (48 kHz, interleaved signed 16-bit samples, one or two channels).
The CSS box primitives: per-corner rounded fills, rounded border rings with per-side widths and colors, angled multi-stop linear gradients, and box shadows with offset, spread, blur, and inset — everything a CSS box paints behind its content.
The CSS box primitives: per-corner rounded fills, rounded border rings with per-side widths and colors, angled multi-stop linear gradients, and box shadows with offset, spread, blur, and inset — everything a CSS box paints behind its content.
Bidirectional resolution (UAX #9) for every text path in the toolkit (#68): mixed Hebrew/Arabic + Latin lines resolve into directional runs that the shaper lays out visually correct, and the editable widgets map caret motion through.
Bidirectional resolution (UAX #9) for every text path in the toolkit (#68): mixed Hebrew/Arabic + Latin lines resolve into directional runs that the shaper lays out visually correct, and the editable widgets map caret motion through.
third_party
vk
Package vk provides Pure Go Vulkan bindings using goffi for FFI calls.
Package vk provides Pure Go Vulkan bindings using goffi for FFI calls.
vk/internal/ffi
Package ffi is the slice of goffi's API the Vulkan bindings call through, carried out by github.com/ebitengine/purego: purego and goffi each link a runtime shim (fakecgo) and cannot share a program, and purego is the one lys-ui's applications already use to load native libraries.
Package ffi is the slice of goffi's API the Vulkan bindings call through, carried out by github.com/ebitengine/purego: purego and goffi each link a runtime shim (fakecgo) and cannot share a program, and purego is the one lys-ui's applications already use to load native libraries.
Package udmabuf allocates linear, CPU-visible dmabufs through /dev/udmabuf: a sealed memfd wrapped as a dmabuf, so tests and demos can hand the compositor dmabufs they fill and read without a GPU library.
Package udmabuf allocates linear, CPU-visible dmabufs through /dev/udmabuf: a sealed memfd wrapped as a dmabuf, so tests and demos can hand the compositor dmabufs they fill and read without a GPU library.
Package vinput injects pointer and keyboard input into the compositor through zwlr_virtual_pointer_v1 and zwp_virtual_keyboard_v1, on a private Wayland connection: the input half of a remote-desktop bridge, and of lys-ui's own headless test harness.
Package vinput injects pointer and keyboard input into the compositor through zwlr_virtual_pointer_v1 and zwp_virtual_keyboard_v1, on a private Wayland connection: the input half of a remote-desktop bridge, and of lys-ui's own headless test harness.
Package wlr implements the alpha_modifier_v1 protocol
Package wlr implements the alpha_modifier_v1 protocol
Package wltest helps tests run Wayland clients: a private runtime dir and a loopback display for wire-level tests with no compositor, and, against the headless compositor the test recipes boot, a client that puts solid-colored surfaces on screen for capture tests to find.
Package wltest helps tests run Wayland clients: a private runtime dir and a loopback display for wire-level tests with no compositor, and, against the headless compositor the test recipes boot, a client that puts solid-colored surfaces on screen for capture tests to find.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL