MCPcopy Index your code
hub / github.com/MaxVerevkin/wayrs

github.com/MaxVerevkin/wayrs @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
357 symbols 661 edges 36 files 66 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

wayrs

A simple Rust implementation of Wayland client library.

Design decisions

  • Single event queue
  • No interior mutability
  • No libwayland compatibility
  • Support blocking, non-blocking and async IO

Project status

  • The main crate, wayrs-client, is feature complete and stable.

Project structure

The project is split into multiple crates:

  • wayrs-client: The main crate which implements Wayland wire protocol. Provides Connection type which represents open Wayland socket, manages objects and handles callbacks.
  • wayrs-protocols: A collection of Wayland protocols to use with wayrs-client.
  • wayrs-utils: A collection of utils and abstractions for wayrs-client. Includes a shared memory allocator and more.
  • wayrs-egl: Brings OpenGL(-ES) to wayrs. Based on EGL_KHR_platform_gbm.
  • wayrs-scanner: Implements the wayrs_client:::generate! macro that generates glue code from .xml files. Generated code for the core protocol is already included in wayrs-client::protocol. Do not use this crate directly.
  • wayrs-proto-parser: Parses wayland .xml files. Used by wayrs-scanner.
  • wayrs-core: The core types, marshalling and unmarshalling implementation. Can be used by clients and servers.

Projects using wayrs

The following projects use wayrs and may serve as additional usage examples:

  • [i3bar-river]: Port of i3bar for river.
  • [i3status-rs]: Feature-rich and resource-friendly replacement for i3status.
  • [river-kbd-layout-watcher]: Prints current keyboard layout whenever it changes.
  • [wayidle]: Waits until the compositor reports being N seconds idle.
  • [way-secure]: Create wayland security contexts.
  • [wl-gammarelay-rs]: Provides DBus interface to control display temperature and brightness without flickering.
  • [wlr-which-key]: Keymap manager for wlroots-based compositors.

MSRV

1.79

Extension points exported contracts — how you extend this code

Transport (Interface)
An abstraction over Wayland transport methods [1 implementers]
wayrs-core/src/transport.rs
Proxy (Interface)
A Wayland object proxy. This trait is implemented automatically for generated proxies, do not implement it yourself.
wayrs-client/src/object.rs
DmabufFeedbackHandler (Interface)
(no doc) [1 implementers]
wayrs-utils/src/dmabuf_feedback.rs
ArgExt (Interface)
(no doc) [1 implementers]
wayrs-scanner/src/lib.rs
GlobalExt (Interface)
(no doc) [1 implementers]
wayrs-client/src/global.rs
KeyboardHandler (Interface)
(no doc)
wayrs-utils/src/keyboard.rs
GlobalsExt (Interface)
(no doc) [1 implementers]
wayrs-client/src/global.rs
SeatHandler (Interface)
(no doc)
wayrs-utils/src/seats.rs

Core symbols most depended-on inside this repo

iter
called by 42
wayrs-utils/src/seats.rs
as_ref
called by 28
wayrs-egl/src/drm.rs
contains
called by 13
wayrs-egl/src/egl.rs
make_pascal_case_ident
called by 10
wayrs-scanner/src/lib.rs
version
called by 8
wayrs-egl/src/egl.rs
write_uint
called by 8
wayrs-core/src/ring_buffer.rs
byte
called by 8
wayrs-scanner/src/mini_syn.rs
make_ident
called by 7
wayrs-scanner/src/lib.rs

Shape

Method 221
Class 70
Function 37
Enum 19
Interface 10

Languages

Rust100%

Modules by API surface

wayrs-client/src/connection.rs34 symbols
wayrs-egl/src/egl.rs25 symbols
wayrs-core/src/lib.rs24 symbols
wayrs-utils/src/shm_alloc.rs20 symbols
wayrs-core/src/transport.rs19 symbols
wayrs-core/src/ring_buffer.rs19 symbols
wayrs-client/src/object.rs19 symbols
wayrs-utils/src/seats.rs17 symbols
wayrs-scanner/src/lib.rs17 symbols
wayrs-utils/src/cursor.rs16 symbols
wayrs-egl/src/buffer.rs15 symbols
wayrs-utils/src/keyboard.rs13 symbols

For agents

$ claude mcp add wayrs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact