Skip to content

rustbar

A small Tauri v2 system-tray app: React + TypeScript renders a live particle playground, while a Rust simulation owns motion, wall bounces, and elastic body collisions. The Rust engine publishes a snapshot 40 times per second and emits separate collision events.

Requirements

  • mise to install the versions pinned in mise.toml (Rust, Node.js, pnpm, and the Tauri CLI)
  • The native WebKitGTK/GTK development packages required by Tauri on Linux. On Debian/Ubuntu these include libwebkit2gtk-4.1-dev, build-essential, curl, wget, file, libxdo-dev, libssl-dev, librsvg2-dev, and libayatana-appindicator3-dev.

Install and run

From this directory:

mise run install
mise run run

mise run install installs JavaScript dependencies from the committed pnpm lockfile and fetches Rust dependencies from Cargo.lock. The app opens a desktop window and installs a system-tray icon. Closing the window hides it; choose Show rustbar or Quit from the tray menu.

Checks and tests

mise run check

The check task performs a strict TypeScript/Vite production build, runs Rust physics tests, and runs Clippy over all targets/features with both all and pedantic enabled and warnings denied. Physics tests cover movement, wall reflection, body collision resolution, separating overlaps, pause, and reset.

Architecture

  • src-tauri/src/physics.rs is a deterministic, independently tested 2D physics engine.
  • src-tauri/src/lib.rs exposes snapshot, pause/resume, and reset commands; its 40 Hz loop emits simulation-update snapshots and collision events.
  • src/ui/App.tsx subscribes to those events and draws the world as SVG. Tailwind CSS 4 and daisyUI 5 provide the compact desktop UI.
  • src-tauri/src/lib.rs also owns the native tray menu and close-to-hide behavior.