Skip to content

mavdi/aurelia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aurelia

A toddler-bash game where every key paints colour.

aurelia demo: colourful shape bursts on keypress

MIT License Built with Rust SDL3 Wayland-first Linux


Why

A six-month-old's hands are uncoordinated and unpredictable. Sat at a keyboard they will mash keys at random — including the Super key, modifier combinations, and anything else the compositor reserves. On Hyprland and other modern Wayland compositors, those keystrokes leak out of any normal application window and trigger compositor actions: workspace switches, application launchers, lock screens. Classic baby-bash games such as BabySmash and bambam were designed for X11 and do not handle Wayland keyboard routing correctly.

aurelia uses zwp_keyboard_shortcuts_inhibit_v1 — the Wayland keyboard-shortcuts inhibit protocol — to take exclusive ownership of every key the moment the window is focused. Nothing escapes to the compositor. Random mashing produces only calm, colourful bursts of shapes. It is a kiosk-style, Linux-native, SDL3-backed alternative to BabySmash and bambam, built from scratch in Rust to run correctly on Hyprland and any other compositor that supports the inhibit protocol.

Adults exit cleanly via a deliberate 4-key chord that a toddler is statistically unlikely to hit. A faint on-screen hint and a progress arc guide the adult through the exit sequence without exposing it to the child.

Features

  • Full keyboard capture on Wayland (Hyprland, Sway, KDE, GNOME) — Super, modifiers, every key — via zwp_keyboard_shortcuts_inhibit_v1
  • Calm visual rewards: 6 procedurally-generated shape types, 4 palettes (random per burst), hue-drifting background
  • Safe-exit chord — Ctrl+Alt+Shift+Q held for 1 second — with an on-screen progress arc
  • Faint corner hint showing the exit shortcut, visible to adults, unreadable to toddlers
  • Multi-monitor selection: list displays and pick by name
  • Configurable particle cap with oldest-eviction (default 500)
  • Single static binary, zero runtime dependencies
  • MIT license

Install

Build dependencies: cmake and a C compiler (GCC or Clang) — required to build libSDL3 from source; Rust 1.79 or later (rustup recommended).

Build:

cargo build --release

Install to ~/.local/bin:

./packaging/install.sh

The script installs the binary to ~/.local/bin/aurelia and the .desktop entry to ~/.local/share/applications/.

Run

# Launch on the primary monitor
aurelia

# List available monitors
aurelia --list-monitors

# Launch on a specific monitor
aurelia --monitor DP-1

# Require a 3-second hold to exit (stricter for wriggly toddlers)
aurelia --exit-hold-ms 3000

aurelia --exit-keys ctrl,shift,q   # custom safe-exit chord (default ctrl,alt,shift,q)

# Lock the colour palette
aurelia --palette pastel

# Cap particles lower on slower hardware
aurelia --max-particles 200

# Verbose logging
RUST_LOG=debug aurelia

Exit

Hold Ctrl+Alt+Shift+Q for one second. A progress arc appears on screen as the chord is held — release early to cancel. Once the arc completes, the window closes.

Emergency escape

If the chord is not working (e.g., keyboard grab did not release):

  • Switch to another TTY: Ctrl+Alt+F2 (or F3F6), then pkill aurelia
  • Or SSH in from another machine and run pkill aurelia

CLI flags

Flag Argument Default Description
--monitor display name primary SDL display name to run on
--list-monitors Print available display names and exit
--exit-keys comma-separated keys ctrl,alt,shift,q Keys that form the exit chord
--exit-hold-ms milliseconds 1000 How long the chord must be held
--max-particles count 500 Hard cap on live particles (oldest evicted)
--palette palette name random Lock all bursts to one palette

How it works

aurelia calls SDL3's set_keyboard_grab(true), which in turn binds zwp_keyboard_shortcuts_inhibit_v1 on the active Wayland surface, preventing the compositor from acting on any key event for the lifetime of the grab. A single-threaded main loop polls SDL events; each keypress event enqueues particles into a fixed-capacity pool — when the pool is full, the oldest particle is evicted to make room — and each particle moves via a semi-implicit Euler integrator with per-particle drag. Shape textures (circle, rounded square, triangle, star, heart, blob) are drawn procedurally at startup and rendered with additive-blend textures for the characteristic bright-on-dark look. Exit is managed by a chord state machine that tracks a bitmask of currently-held modifier keys and measures elapsed hold time against --exit-hold-ms.

Building from source

cargo build --release

# Run the integration smoke tests (SDL3 must initialise on the main thread)
cargo test --test smoke_test -- --test-threads=1

License

MIT — see LICENSE.

About

Toddler-bash game for Linux/Wayland. Captures every key (incl. Super on Hyprland) via the Wayland keyboard-shortcuts inhibit protocol and rewards bashing with calm, colourful particle bursts. Single static Rust binary on SDL3.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors