Linux Platform Support
Linux Platform Support
Section titled “Linux Platform Support”Linux-specific implementation details for Toss.
Display Server Support
Section titled “Display Server Support”Linux supports both X11 and Wayland, each with different clipboard APIs:
- X11: Uses xcb or Xlib for clipboard access
- Wayland: Uses wl-clipboard or similar protocols
Implementation Status: Detection logic created in linux_display.rs. Full implementation requires both X11 and Wayland backends.
Files:
rust_core/src/clipboard/linux_display.rs
Priority:
- Detect display server (X11 vs Wayland)
- Implement X11 clipboard (xcb)
- Implement Wayland clipboard (wl-clipboard)
- Handle display server switching
Implementation Details
Section titled “Implementation Details”Display Server Detection
Section titled “Display Server Detection”Detect which display server is running:
fn detect_display_server() -> DisplayServer { if std::env::var("WAYLAND_DISPLAY").is_ok() { DisplayServer::Wayland } else if std::env::var("DISPLAY").is_ok() { DisplayServer::X11 } else { DisplayServer::Unknown }}X11 Clipboard
Section titled “X11 Clipboard”Use xcb for X11 clipboard access:
// X11 clipboard implementationlet connection = xcb::Connection::connect(None)?;// Access clipboard via xcbWayland Clipboard
Section titled “Wayland Clipboard”Use wl-clipboard for Wayland:
// Wayland clipboard implementation// Use wl-clipboard crate or similarDependencies
Section titled “Dependencies”sudo apt-get install libxcb1-dev libxcb-render0-devWayland
Section titled “Wayland”sudo apt-get install libwayland-devSystem Integration
Section titled “System Integration”- Keyring: Secure storage for device keys (libsecret)
- System Tray: Desktop environment integration
- Notifications: Desktop notifications
Next Steps
Section titled “Next Steps”- Platform Overview - Return to platform overview
- macOS Implementation - macOS platform details