Helium

A modern Wayland shell library wrapping layer-shika

What is Helium?

Helium is a Rust library for building Wayland shell surfaces — bars, panels, overlays, and widgets — with minimal boilerplate. It wraps layer-shika and exposes a fluent builder API, a configuration macro, compositor auto-detection, and an adapter system for wiring state to UI properties.

Features

FeatureDescription
Fluent builder APIHelium::from_file("ui.slint").surface("bar").size(1920, 42).exclusive().build()
helium_config!Declare typed config structs with defaults in a DSL — generates serde parsing, Default, and a load(path) method
Compositor detectionAuto-detect Hyprland, Niri, Sway, or MangoWM from environment variables
Adapter systemPlug-in adapters (ClockAdapter, WorkspacesAdapter) that set surface properties on tick/event
System servicesFree-function wrappers for audio, backlight, Bluetooth, network, power, power profiles, and time
Macroshelium_struct!, helium_model!, adapters!, helium_config!

Quick Start

Add Helium to your Cargo.toml:

[dependencies]
helium-wsl = "0.2.0"

Define your UI in a .slint file:

// my-bar.slint
export component Bar {
    width: 1920px;
    height: 42px;
    in property <string> label;
    Rectangle {
        background: #141414;
        Text { text: label; color: #d4d4d4;
               vertical-alignment: center;
               horizontal-alignment: center; }
    }
}

Create the surface in Rust:

use helium_wsl::{AnchorEdge, Helium, Layer};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let mut shell = Helium::from_file("my-bar.slint")
        .surface("main")
        .size(1920, 42)
        .anchor((AnchorEdge::Top, AnchorEdge::Left, AnchorEdge::Right))
        .layer(Layer::Top)
        .exclusive()
        .build()?;

    shell.on_tick(std::time::Duration::from_secs(1), |ctx| {
        ctx.set("main", "label", "hello world");
    })?;

    shell.run()?;
    Ok(())
}

Ecosystem

Helium is built on layer-shika, a Rust binding for the Layer Shell protocol (zwlr_layer_shell_v1). It uses Slint for declarative UI definitions.