30 releases (11 stable)

new 1.3.1 May 19, 2025
1.3.0 Feb 1, 2025
1.2.0 Jan 4, 2025
1.1.3 Nov 17, 2024
0.1.0 Dec 26, 2022

#972 in GUI

Download history 647/week @ 2025-01-29 371/week @ 2025-02-05 402/week @ 2025-02-12 327/week @ 2025-02-19 280/week @ 2025-02-26 232/week @ 2025-03-05 509/week @ 2025-03-12 440/week @ 2025-03-19 268/week @ 2025-03-26 338/week @ 2025-04-02 324/week @ 2025-04-09 427/week @ 2025-04-16 363/week @ 2025-04-23 332/week @ 2025-04-30 557/week @ 2025-05-07 528/week @ 2025-05-14

1,862 downloads per month
Used in 14 crates (11 directly)

MIT license

87KB
2K SLoC

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

Dependencies

~1.2–9.5MB
~82K SLoC