A Rust implementation of wayland-info, a tool for displaying detailed information about Wayland compositor interfaces and their capabilities.
wayland-info-rs is a command-line utility that connects to a Wayland compositor and displays comprehensive information about available global interfaces, including detailed information for specific interfaces like wl_seat and wl_output.
- Global Interface Discovery: Lists all available Wayland global interfaces with their names, interface types, and versions
- Structured Output: Collects all information before displaying, ensuring consistent and organized output
- Colorized Output: Uses colored text to highlight different types of information
Displays comprehensive seat information including:
- Seat name (e.g., "seat0")
- Capabilities (pointer, keyboard, touch)
- Keyboard repeat rate and delay settings
Example output:
name: 10 interface: wl_seat version: 9
name: seat0
capabilities: pointer keyboard
keyboard repeat rate: 25
keyboard repeat delay: 600
Shows detailed display output information including:
- Output name and description
- Physical dimensions and position
- Manufacturer and model information
- Subpixel orientation and transform settings
- Available display modes with resolution, refresh rate, and flags
Example output:
name: 59 interface: wl_output version: 4
name: eDP-1
description: BOE CQ eDP-1-0x0747
x: 0, y: 0, scale: 1,
physical_width: 344 mm, physical_height: 194 mm,
make: 'BOE CQ', model: 'eDP-1-0x0747',
subpixel_orientation: unknown, output_transform: normal,
mode:
width: 1920 px, height: 1080 px, refresh: 60.027 Hz,
flags: current
- Rust toolchain (cargo, rustc)
- Wayland development libraries
- A Wayland compositor running
git clone <repository-url>
cd wayland-info-rs
cargo build --release# Run directly with cargo
cargo run
# Or run the built binary
./target/release/wayland-info-rsSimply run the binary in a Wayland session:
wayland-info-rsThe tool will automatically:
- Connect to the Wayland compositor
- Discover all available global interfaces
- Collect detailed information for supported interfaces
- Display the information in a structured format
WAYLAND_DISPLAY: If not set, defaults to "wayland-0"
- Uses
wayland-clientcrate for Wayland protocol communication - Implements event-driven architecture with
Dispatchtraits - Collects all information before displaying to ensure proper ordering
wl_registry: Global interface discoverywl_seat: Input device and seat informationwl_output: Display output informationwl_keyboard: Keyboard-specific information
The application implements several Dispatch traits:
Dispatch<wl_registry::WlRegistry, ()>: Handles global interface discoveryDispatch<WlSeat, SeatData>: Processes seat eventsDispatch<WlKeyboard, SeatData>: Handles keyboard eventsDispatch<WlOutput, OutputData>: Processes output events
The output follows a consistent format:
- Global interfaces are listed with name, interface type, and version
- Detailed information for specific interfaces follows immediately after their global entry
- Information is indented for better readability
- Color coding helps distinguish different types of data
This Rust implementation provides the same functionality as the original C wayland-info tool but with:
- Memory safety through Rust's ownership system
- Better error handling
- More maintainable code structure
- Type-safe protocol handling
Contributions are welcome! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the same terms as the original wayland-info project.
wayland-client: Wayland client librarycolored: Terminal colorization- Standard Rust libraries
To work on this project:
- Clone the repository
- Install Rust toolchain
- Run
cargo checkto verify compilation - Run
cargo runto test the application - Use
cargo testto run tests (when implemented)
Potential areas for improvement:
- Support for additional Wayland protocols
- JSON output format option
- Filtering capabilities
- More detailed error reporting
- Configuration file support