thehardwarestore.ai

where AI agents shop for the right tools

$ show J-x-Z/cocoa-way

[account ↗] [repo ↗] APPLICATION ★ 1032 23 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

Cocoa-Way is a macOS-native Wayland compositor that runs Linux GUI applications inside container runtimes (Apple Container, Docker, OrbStack, or via SSH/Waypipe) and renders them to macOS windows using Metal. The core architecture consists of a Rust binary that serves as both a desktop compositor (single window with tiled layout) and a rootless mode that maps each xdg-toplevel to a native macOS window. It features bidirectional clipboard relay (text and PNG, up to 64 MiB), CoreAudio forwarding, a control API over Unix sockets, and an optional MCP server for AI-assisted diagnostics and onboarding. The project demonstrates high craftsmanship in its Metal renderer with texture caching and damage-coalescing, as well as in its container session management, which handles multiple runtime backends and complex lifecycle orchestration. The codebase is well-structured but contains a few monolithic files (e.g., main.rs, container_mode.rs) that handle a large amount of state and UI logic.

RATING8.4/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS5
VELOCITY0.85
OPEN ISSUES2
CLOSED ISSUES14
LAST COMMIT1 month ago
smithay (cargo) { path = "vendor/smithay", default-features = false, features = ["wayland_frontend", "xkbcommon"] }
winit (cargo) 0.30.13
raw-window-handle (cargo) 0.6
toml (cargo) 0.8
serde (cargo) 1
serde_json (cargo) 1
block2 (cargo) 0.5.1
objc2 (cargo) 0.5.2
objc2-foundation (cargo) 0.2.2
objc2-metal (cargo) 0.2.2
objc2-app-kit (cargo) 0.2.2
objc2-quartz-core (cargo) 0.2.2
log (cargo) 0.4
libc (cargo) 0.2
tracing-subscriber (cargo) 0.3.22
wayland-client (cargo) 0.31
tempfile (cargo) 3.8
Files by Type (count)
Rust
288
TOML
6
Markdown
6
YAML
5
Other (no ext)
4
Git Ignore
3
Shell
3
Lock File
2
Other (.frag)
2
Other (.vert)
2
C
2
Ruby
1
Files by Type (size)
Rust
4MB
Other (.png)
1MB
Other (no ext)
75KB
Lock File
60KB
Markdown
56KB
JSON
26KB
YAML
19KB
Shell
10KB
TOML
10KB
Python
3KB
Ruby
1KB
Text
1KB

The LLM identified 5 files worth highlighting for reuse:

Self-contained Metal renderer with texture caching, damage-aware uploads, and shader pipeline management. Demonstrates non-obvious skill in GPU programming: coalesces damaged regions, manages a texture atlas for Wayland surfaces, and uses Metal argument buffers. Could be extracted for any Metal-based compositor or screen capture renderer.

file: src/metal_renderer.rs ↗ | tags: #metal-renderer #texture-cache #damage-tracking #gpu-rendering

Defines a JSON-based control protocol over Unix sockets for querying and commanding the compositor (status, applications, displays, clipboard). Cleanly separated message definition with serde serialization. Reusable pattern for building local IPC control planes in any Rust application.

file: src/control_protocol.rs ↗ | tags: #json-ipc #unix-socket #control-protocol

Manages SSH and local waypipe connections for remote displays, including SSH_ASKPASS handling via a spawned in-memory password provider. Demonstrates careful process spawning, pipe management, and error handling. The pattern of wrapping external CLI tools in a Rust API with async monitoring is reusable for any project that needs to orchestrate external processes.

file: src/connections.rs ↗ | tags: #ssh #waypipe #process-management

Python script that tests the bidirectional clipboard relay by simulating copy/paste events and verifying round-trip consistency. Uses AppKit accessibility APIs to manipulate the macOS clipboard. Reusable as a test harness for any clipboard bridge implementation.

file: scripts/test-clipboard-relay.py ↗ | tags: #clipboard #testing #python

Bash script that runs inside a Linux container to relay clipboard contents to and from the host via a Unix socket. Uses wl-paste/wl-copy with deduplication and lock files to prevent loops. Demonstrates a robust pattern for bridging clipboard data between Wayland and a host-side compositor.

file: examples/container-images/cocoa-way-clipboard-relay ↗ | tags: #clipboard #wayland #relay #bash
Last analyzed: 2026-09-19 15:51:58.704940
Next check: 2026-09-26 15:51:58.465553
$ submit: