A zero-bloat, Wayland-native application launcher and command hub written in Rust.
Most application launchers are relics of the X11 era β ported forward with compatibility shims, dynamically linked against half of GTK, and polling the filesystem on every keystroke. Barycenter exists because the modern Wayland desktop deserves better.
Built from scratch in Rust with iced and iced_layershell, Barycenter talks directly to the Wayland compositor via the wlr-layer-shell protocol. There is no X11 fallback, no GLib main loop, and no runtime garbage collector. The binary is statically optimized with LTO and ships at ~12 MB stripped β compositor blur, exclusive keyboard grab, and sub-millisecond fuzzy matching included.
The architecture follows a strict modular Runner pattern: each capability (application search, calculator, system commands) is an isolated module behind a single trait. Adding a new runner is adding a file, not touching a framework.
Important
Barycenter requires a Wayland compositor that implements the wlr-layer-shell-unstable-v1 protocol. This includes Hyprland, Sway, river, and labwc. GNOME and KDE Plasma do not support this protocol natively.
- Wayland layer-shell native β renders on
Layer::Overlayviawlr-layer-shell, no X11/XWayland dependency - Spawns on the active monitor β
StartMode::Activeplaces the window where your focus already is - Exclusive keyboard grab β
KeyboardInteractivity::Exclusivecaptures input immediately on launch; no click-to-focus - Sub-millisecond fuzzy search β powered by
nucleo-matcher, the same engine behind the Helix editor - Modular Runner architecture β pluggable
Runnertrait with three built-in modules:AppRunnerβ parses.desktopfiles at startup, caches in memory, deduplicates, fuzzy-matches with scored rankingCalcRunnerβ real-time math evaluation viameval; result copies to clipboard withwl-copySysRunnerβ system commands (lock, logout, reboot, shutdown, suspend, hibernate) vialoginctl/systemctl
- Embedded config bootstrap β a beautifully commented
config.tomlis baked into the binary at compile time and written to disk on first run via the XDG base directory spec - "Cosmic Dawn" theme β deep purple borders, translucent dark background with compositor blur passthrough, soft off-white text, vivid accent highlights β fully configurable via hex RGBA
- Zero-polling β event-driven architecture; the process is idle until you type
- Minimal dependency surface β no GTK, no Qt, no Electron; just
iced,iced_layershell, and a handful of focused crates - Release-optimized β
opt-level = 3, LTO, single codegen unit, stripped symbols
Requires a working Rust toolchain (1.85+ recommended). The Wayland development libraries (wayland-client, wayland-protocols) must be present on the system.
git clone https://github.com/cptdawn/BaryCenter.git
cd BaryCenter
cargo build --releaseThe binary is written to target/release/barycenter. Copy it to a location on your $PATH:
sudo install -Dm755 target/release/barycenter /usr/local/bin/barycenteryay -S barycenterNote
The AUR package name is a placeholder and will be updated once the package is published.
Barycenter uses an embedded asset bootloader pattern:
- A fully commented default configuration is compiled into the binary via
include_str!at build time. - On first launch, if
~/.config/barycenter/config.tomldoes not exist, the embedded default is written to disk. - On every subsequent launch, the on-disk file is read and parsed. User edits are always respected.
- To reset to defaults, simply delete the file β it will be regenerated on the next run.
~/.config/barycenter/config.toml
# βββ Window Geometry ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
width = 680
height = 480
# βββ Colors (hex RRGGBBAA β last two digits are alpha) ββββββββββββββββββββββββ
border_color = "#7B2FBEff" # Vivid deep purple border
background_color = "#0D0B1Fcc" # Near-black, translucent (compositor blur)
text_color = "#E8E0F0ff" # Soft off-white
accent_color = "#A855F7ff" # Selected result highlight
# βββ Typography βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
font_family = "Inter" # System font (fallback: iced default sans-serif)
font_size = 22.0 # Base size for the search input (px)
# βββ Behavior βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
max_results = 8 # Maximum visible results
border_width = 2.0 # Window border thickness (px)
border_radius = 12.0 # Corner rounding (px)| Key | Type | Description |
|---|---|---|
width / height |
u32 |
Window dimensions in pixels. Centered on the active monitor. |
border_color |
String |
#RRGGBB or #RRGGBBAA hex color for the window border. |
background_color |
String |
Window background. Set the alpha channel below ff for compositor blur passthrough. |
text_color |
String |
Primary text color for input and result titles. |
accent_color |
String |
Highlight color for the selected result row and badges. |
font_family |
String |
Preferred font family name. Must be installed on the system. |
font_size |
f32 |
Base font size in pixels. Result text scales proportionally. |
max_results |
usize |
Maximum number of search results rendered at once. |
border_width |
f32 |
Border thickness around the launcher window. |
border_radius |
f32 |
Corner radius for the window and result row containers. |
Barycenter is designed to be launched on-demand via a compositor keybind. It captures the keyboard, runs the query, and exits after execution or dismissal.
Add to ~/.config/hypr/hyprland.conf:
bind = $mainMod, SPACE, exec, barycenterAdd to ~/.config/sway/config:
bindsym $mod+space exec barycenter
| Key | Action |
|---|---|
| Any text | Fuzzy search across applications, calculator, and system commands |
β / β |
Navigate results |
Tab |
Move to next result |
Enter |
Execute the selected result |
Escape |
Dismiss the launcher |
- Applications β Always active. Searches
.desktopentries from/usr/share/applications,/usr/local/share/applications, and~/.local/share/applications. Deduplicates by name (user entries override system). Launches theExeccommand directly. - Calculator β Activates when input contains digits and a math operator (
+,-,*,/,^,%,(). PressingEnteron a calc result copies the value to the Wayland clipboard viawl-copy. - System β Activates on fuzzy match against keywords:
lock,logout,reboot,shutdown,suspend,hibernate. Executes vialoginctl/systemctl.
| Dependency | Required By | Purpose |
|---|---|---|
wl-copy |
CalcRunner | Clipboard access for calculator results |
loginctl |
SysRunner | Session locking, logout |
systemctl |
SysRunner | Reboot, shutdown, suspend, hibernate |
src/
βββ main.rs # Entrypoint: logging β config boot β runner init β layer-shell launch
βββ config.rs # Embedded asset bootloader, XDG path resolution, TOML parsing
βββ search.rs # nucleo-matcher wrapper (fuzzy_score, fuzzy_rank)
βββ runner/
β βββ mod.rs # Runner trait + RunnerResult struct
β βββ app.rs # .desktop file parser, in-memory cache, fuzzy search, Command launch
β βββ calc.rs # Math expression detection + meval evaluation + wl-copy clipboard
β βββ sys.rs # System command keywords + loginctl/systemctl execution
βββ ui/
βββ mod.rs # iced application: state machine, message handling, view rendering
βββ theme.rs # Cosmic Dawn: container, text input, scrollable, result row styles
Contributions are welcome. Please open an issue before submitting large changes to discuss the approach.
- Fork the repository
- Create a feature branch (
git checkout -b feat/your-feature) - Commit with clear messages
- Open a Pull Request against
main
All code must pass cargo check, cargo clippy, and cargo fmt --check with no warnings.
MIT Β© 2026 Swastik Patel
