termui
Run graphical Wayland applications in the terminal using the Kitty graphics protocol.
Yes, you see it right. It's kitty running in kitty under a Wayland compositor which renders it into kitty through kitty's graphics protocol.
Why? Because fuck you.
It wasn't me, it was Claude.
More:
Overview
termui acts as a minimal Wayland compositor that:
- Captures frames from Wayland applications
- Renders them in the terminal using Kitty's graphics protocol
- Translates terminal input (keyboard/mouse) back to Wayland events
Requirements
- A terminal supporting the Kitty graphics protocol (e.g., Kitty)
- Nix with flakes enabled (for dependencies)
Building
nix develop cargo build --release
Usage
./target/release/termui <command> [args...]
Examples
# Run foot terminal termui foot # Run a GTK4 application termui gtk4-demo
Controls
Ctrl+QorCtrl+C- Exit termui
How it works
- termui creates a Wayland socket and spawns the target application
- The application renders to shared memory buffers (wl_shm)
- termui captures frames on each surface commit
- Frames are encoded and sent to the terminal via Kitty graphics protocol
- Terminal input events are translated to Wayland pointer/keyboard events
Limitations
- Only supports wl_shm (software rendering) - no GPU acceleration
- Input latency depends on terminal and frame rate
- Some applications may not work correctly
License
MIT