Raclettui
Build terminal-themed wayland layer shell applications with Rust.
Install / Use
/learn @ishrut/RaclettuiREADME
Raclettui
Build terminal-themed wayland layer shell applications with Rust. Powered by Ratatui.
About
Raclettui allows you to create windows using wayland layer shell protocol and implements the Ratatui Backend trait to draw terminal style UIs. Layer shell protocol is usually used to create menus, bars and lockscreens. This project is still under active development. Expect bugs and breaking changes. However, it works if you would like to try it out. It has cpu and wgpu rendering backends. This library was developped to cook a UI for my project as no UI libraries in the rust ecosystem implementing the layer shell protocol were to my liking.
Quickstart
Setup
Add Raclettui as a dependency in your Cargo.toml:
cargo add raclettui
Here is a minimal example:
use raclettui::{
WindowBuilder,
layer::{Anchor, Layer, KeyboardInteractivity},
events::{WindowEvent, KeyCode},
};
use ratatui::{
Terminal,
border,
style::{Style, Styled},
widgets::{Block, Paragraph}
};
fn main(){
let window = WindowBuilder::new()
.set_namespace("example")
.set_width(300)
.set_height(300)
.set_layer(Layer::Top)
.set_anchor(Anchor::Top)
.set_keyboard_interactivity(KeyboardInteractivity::OnDemand)
.set_font_path("fonts/Some-Mono-Font.ttf")
.set_font_size(18.)
.bg_alpha(0.5)
.init_wgpu();
let events = window.get_event_queue();
let mut terminal = Terminal::new(window).unwrap();
'app_loop: loop{
terminal.draw(|f| {
let size = f.area();
let paragraph = Paragraph::new("Hello World")
.block(
Block::new()
.borders(border!(TOP, BOTTOM, RIGHT, LEFT))
)
.set_style(Style::new().fg(ratatui::style::Color::Red).bg(ratatui::style::Color::Blue));
f.render_widget(paragraph, size);
}).unwrap();
for ev in events.drain() {
if let WindowEvent::Keyboard(key_event) = ev {
match key_event.code {
KeyCode::Char('q') => break 'app_loop,
_ => {}
}
}
}
}
}
Demo
Converting the bluetui app interface in to a layer shell window is as simple as switching the backend. However, converting the crossterm events to window events is still a work in progress. <a><img src="https://github.com/ishrut/raclettui/blob/main/assets/bluetuidemo.png" width="500"></a>
Documentation
Acknowledgements
Thanks to Ratzilla projects for the inspiration. Thanks to Ratatui for providing the core UI components.
Contributing
Pull requests are welcome! Please see todo list: TODO
Copyright
Copyright © 2025, Ishrut
Related Skills
node-connect
353.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
353.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
353.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
