Files
aero3/docs/DESIGN.md
T

68 lines
3.4 KiB
Markdown
Raw Normal View History

2026-06-19 10:02:12 -04:00
# AeroOS design notes
## What "from scratch" means here
AeroOS is built with the **Linux From Scratch** method: a cross toolchain is
compiled, then every package is built from upstream source into a clean root
filesystem. There is **no Debian/Arch/Fedora base**. The only pre-existing thing
reused is the host's compiler to bootstrap the cross-compiler (standard LFS).
Pipeline: `cross toolchain → temporary tools → chroot → final base → kernel →
systemd/boot → Wayland desktop → Aero theme → live ISO`.
## Glassmorphism: how the frosted glass is actually produced
A full per-frame screen blur is expensive and hard to wire into the wlroots
scene graph. `aerowm` instead uses a **pre-blurred wallpaper** technique that is
both authentic and cheap:
1. The wallpaper is cover-scaled to the output (`image.c`).
2. A **blurred copy** is produced once with a separable box blur run 3× to
approximate a Gaussian (`blur.c`, O(n) sliding-window per row).
3. The glass UI (`panel.c`) is drawn with cairo: for each panel it **clips to a
rounded rect, paints the blurred wallpaper inside it**, lays a translucent
white gradient + a cyan sheen on top, then a 1px edge highlight. That is the
frosted-glass look.
4. Layers are stacked in the scene graph: `wallpaper (sharp) < apps < glass UI`.
Result: real frosted translucency where the blurred background shows through the
panels, the welcome card and the dock — the classic Frutiger Aero glass.
The CPU-rendered cairo buffers are handed to wlroots via a tiny custom
`wlr_buffer` (`aero_buffer` in `main.c`) so they live directly in the scene
graph and are composited by the (software/pixman) renderer.
## Why the pixman renderer
The baseline uses wlroots' **pixman software renderer** (`-Drenderers=pixman`),
which removes the Mesa + LLVM dependency for a first bootable image. The blur is
CPU-side anyway. Hardware GL acceleration (Mesa) can be added later by switching
wlroots to the GLES2 renderer and building mesa in `chroot-desktop.sh`.
## Audio / lofi
`assets/lofi/generate_lofi.py` synthesizes a seamless ~27s lofi loop (jazzy
keys + soft kick/hat + vinyl crackle + warm low-pass) using only the Python
stdlib. It plays through **PipeWire** via `pw-play` in a loop, started by the
`aero-lofi` user service that the compositor autostarts. Toggle with `Super+M`.
## Keybindings (aerowm)
| Keys | Action |
|----------------|---------------------------------|
| `Super+Return` | terminal (`foot`/`alacritty`) |
| `Super+D` | launcher (`wofi`/`fuzzel`) |
| `Super+Q` | close focused window |
| `Super+M` | toggle lofi |
| `Super+Esc` | quit the compositor |
## Live ISO
A busybox initramfs (`assets/live/init`) finds the medium by label, mounts the
`LiveOS/aeros.squashfs`, layers a tmpfs via overlayfs and `switch_root`s into
systemd. squashfs/overlay/iso9660/loop are built **into** the kernel
(`config/kernel/aeros.config`) so the initramfs needs no modules. The hybrid
BIOS+UEFI ISO is produced by `grub-mkrescue` (GRUB + xorriso + mtools, all
built in-tree).
## Extending
- Add a package: add it to `config/versions.sh`, add a `p_<name>` recipe to the
relevant `packages/chroot-*.sh`, and a `once` line.
- Swap the wallpaper: replace `assets/wallpaper/frutiger-aero.svg` (or change
`gen_wallpaper.py`).
- Replace the lofi track: drop a WAV at
`/usr/share/aeros/lofi/aero-lofi.wav` or tweak the generator.