Hysen Labs
Open-source project
iluaii/fwm avatar
iluaii

fwm

Wayland compositor in C/wlroots where windows are physical objects (real Box2D rigid bodies) — and a full desktop besides: ten desktops on one scrolling world, tiling or floating per desktop, launcher, expo, screenshots, mixer and visualiser built in, live IPC. Legacy X11 version on the x11 branch.

159 stars5 forksCGPL-2.0
DEEP OPEN-SOURCE ANALYSIS

fwm is a Wayland compositor where windows are rigid bodies

fwm is a wlroots based Wayland compositor written in C that simulates windows as Box2D rigid bodies with mass, momentum and gravity.

Physics as the default behavior

fwm treats every window as a real rigid body with mass, momentum, inertia and velocity, simulated by Box2D version 3. When you drag a window and let go, it slides, bounces off walls, stacks under gravity and eventually comes to rest. The README describes impulse based collisions, proper mass ratios, resting contact and sleeping, so the motion does not rely on a hand written solver that would look wrong. Gravity can be cycled with a keybinding between zero gravity, a space mode and Earth gravity at 9.8 meters per second squared, using the compositor own scale of 100 pixels per meter. A throw samples velocity over the last frames, so a quick flick sends a window flying naturally, while a speed limit keeps any single shove from outrunning the hardest deliberate throw. Windows can be pinned, made non colliding, or calmed entirely using keyboard shortcuts. A separate breakable mode lets a hard enough collision destroy a window, using a damage formula based on mass, speed and hardness, but the mode is deliberately kept out of the config file and resets each session to avoid losing work. Per window rules let you set mass, bounce, friction, gravity, hardness and toughness, so a video player can be eight times heavier than a terminal and a terminal can drift upward like a balloon.

Desktops, tiling and the world

The compositor lays out ten virtual desktops on one continuous strip that the camera travels along, rather than as separate boxes. Each desktop keeps an absolute position in that world, so a thrown window carries its momentum across an edge and may arrive in a region with different gravity. Every desktop chooses its own mode: physics by default, BSP tiling, or plain floating where windows stay where dropped. Tiling is Hyprland style, with dwindle splits, smooth glide animations of about 250 milliseconds, configurable inner and outer gaps, and keyboard control for directional focus and movement. A window can be picked out of the layout by dragging, then dropped beside another or carried onto a different desktop. The README notes that a window opens on the desktop where it was launched, not where the camera happens to be, which keeps Steam launching on desktop 2 even if you are reading on desktop 1. Parallax and animated video wallpapers scroll as you cross the strip, and a pan mode turns one large image into a world you walk across. The three modes are properties of the desktop, so switching a desktop out of physics returns its windows to being ordinary floating surfaces.

Built in tools and overlays

fwm ships a number of features that normally require separate utilities. The app launcher does fuzzy search over desktop entries, matches by keyword and binary name, and learns from what you open, so it surfaces today habits rather than an alphabetical list. Screenshots are built in and copy a PNG straight to the clipboard, while a region shot peels off the screen as it is taken. A sound panel shows every playing application with a master row, driven by pactl by default, and the wallpaper picker applies an image instantly without rewriting the config. A keybind cheat sheet is generated from the actual binds, mouse drags and gestures, not a static list. Other overlays include a radial menu built for a keyboard knob, a dial readout for live settings, and a stats pill showing CPU, RAM, GPU and battery. The README states there are no titlebars anywhere, with a minimal tray of chevron ended islands instead. A crash no longer costs your layout because fwm records running applications and their desktops, and a session wrapper brings them back after an unclean exit, relaunching rather than resuming them. The result is a desktop that needs no rofi, grim, slurp or cava installed alongside.

Configuration, IPC and platform support

The compositor is configured through a config.toml file, and a broken file falls back to built in binds while reporting the problem in a tray pill, so a mistake never costs the session. The fwmctl tool reads state, changes any setting live without touching the config file, and streams events that a script can react to, which gives the compositor a scripting surface. Multiple monitors, layer shell and session lock work as expected, and XWayland works apart from one open bug that the README documents as an invisible window that captures clicks. Touchpad support follows libinput per device settings, and three finger gestures can pan the desktop or fire any action once bound. The legacy X11 version lives on a separate branch and is no longer supported, so the Wayland build is the primary line of development. Documentation is split into getting started, configuration, keybindings, physics, interface, fwmctl and troubleshooting pages, each explaining one area in depth. The site at fwm-website.vercel.app acts as the tour while the in tree docs hold the reference material. The project is published under the GPL-2.0 license and its most recent commit was on 2026-08-26. The documentation set is meant to let a new user start a session and an experienced user change the internals, which matches the dual audience the project serves.

Editorial conclusion

fwm is a Wayland compositor built in C on top of wlroots, and it uses the Box2D version 3 rigid body engine to make windows behave like physical objects. The project is published under the GPL-2.0 license and its most recent commit was on 2026-08-26.

DEEP OPEN-SOURCE ANALYSIS

Official sources

Community notes

Community notes