Open Source › Lamco Wayland
Lamco Wayland
Rust libraries for Wayland screen capture, XDG Portal integration, and video processing
One dependency, three capabilities
lamco-wayland is a meta-crate: add it to your Cargo.toml and select the subset you need via feature flags. All three member crates are independently publishable and usable, but most applications want two or three working together — portal negotiation gives you a PipeWire FD, PipeWire gives you frames, and video turns those frames into RDP-ready bitmaps.
These libraries exist because Wayland screen capture has no equivalent of X11's XShmGetImage. Capture on Wayland must go through a portal + PipeWire. The Rust ecosystem had incomplete bindings, unsafe FFI wrappers, and compositor-specific hacks. lamco-wayland is the unified, memory-safe, async-first alternative — the foundation under Lamco RDP Server.
Three focused libraries
lamco-portal
v0.4.0
XDG Desktop Portal integration. Screencast, remote desktop, clipboard — the sanctioned Wayland capture path.
Portal details →
lamco-pipewire
v0.4.2
PipeWire screen capture with DMA-BUF zero-copy, multi-monitor, damage tracking, and cursor extraction.
PipeWire details →
lamco-video
v0.1.8
Frame processing pipeline, RDP bitmap conversion, damage region tracking, priority-based dispatch, SIMD paths.
Video details →
How the pieces fit
┌─────────────────────────────────────────────────────────────────┐
│ lamco-wayland │
├─────────────────┬─────────────────────┬─────────────────────────┤
│ lamco-portal │ lamco-pipewire │ lamco-video │
│ │ │ │
│ PortalManager │ PipeWireManager │ BitmapConverter │
│ SessionHandle │ VideoFrame │ FrameProcessor │
│ PortalConfig │ PipeWireConfig │ FrameDispatcher │
└────────┬────────┴──────────┬──────────┴────────────┬────────────┘
│ │ │
▼ ▼ ▼
XDG Desktop Portal PipeWire API RDP Bitmap Format
Portal negotiates permission → PipeWire streams pixels → video processes frames into RDP bitmaps.
Add it. Request a session. Capture.
[dependencies]
lamco-wayland = "0.4"
tokio = { version = "1", features = ["full"] }
use lamco_wayland::prelude::*;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Create portal manager
let manager = PortalManager::with_default().await?;
// Create session (triggers permission dialog on the compositor)
let session = manager.create_session("my-session".to_string(), None).await?;
// Access PipeWire FD and stream list for video capture
let fd = session.pipewire_fd();
let streams = session.streams();
println!("Capturing {} streams on PipeWire FD {}", streams.len(), fd);
Ok(())
}
Turn features on/off per crate: features = ["portal"] for portal only;
features = ["full"] for every sub-crate feature.
Where it fits
- •RDP servers — Lamco RDP Server, custom implementations
- •VNC servers — Wayland-native VNC
- •Screen recording tools — capture Wayland displays
- •Video conferencing — screen sharing applications
- •Computer vision — process live Wayland content
- •Accessibility tools — screen readers, automation
What you need
- •A Wayland compositor (GNOME, KDE Plasma, Sway, Hyprland, …)
- •
xdg-desktop-portalinstalled and running - •A portal backend for your compositor
- •PipeWire (for
pipewire/videofeatures) - •Rust 1.85 or newer (edition 2024)
- •X11 is not supported — Wayland only
Tested across the Wayland ecosystem
| Compositor | Status | Portal backend |
|---|---|---|
| GNOME | Tested | xdg-desktop-portal-gnome |
| KDE Plasma | Tested | xdg-desktop-portal-kde |
| Sway / wlroots | Tested | xdg-desktop-portal-wlr |
| Hyprland | Should work | xdg-desktop-portal-hyprland |
| Other Wayland | May work | Depends on portal backend |
| X11 | Not supported | — |
Related work at Lamco
Uses — the reference consumer of lamco-wayland in production.
Part of — the broader set of Lamco-maintained Rust libraries.
Background — the technical reasoning behind Wayland-native capture.
Research — where lamco-video fits in the encoding story.
Build on lamco-wayland
Screen capture on Wayland shouldn't require reading the portal spec. Pull in the meta-crate, pick your features, and ship.