$ show baskerville/bspwm
bspwm is a tiling window manager for X11 that represents windows as leaves of a full binary tree. It uses a client-server architecture: the `bspwm` daemon manages windows and desktops, while the `bspc` command-line client communicates with it over a Unix domain socket. The daemon does not handle input directly; instead, an external helper like `sxhkd` invokes `bspc` to perform actions. Configuration is done via shell scripts (`bspwmrc`) that call `bspc` commands, and the state can be dumped to JSON for restoration. The project is written in C99 with XCB (X11 C Bindings) and supports EWMH/ICCCM standards, multi-monitor setups (RandR/Xinerama), a rule system for window matching, and event subscriptions for external tools like panels.
The LLM identified 3 files worth highlighting for reuse:
Provides a set of pure functions for 2D rectangle geometry: point-in-rect, containment, boundary distance, and axis-aligned direction tests. These are self-contained, have no internal dependencies, and can be extracted for any project needing spatial calculations (e.g., game engines, layout systems). The implementation is clean and demonstrates good mathematical reasoning.
Contains generic helper functions such as `read_string`, `copy_string`, `mktempfifo`, and `tokenize_with_escape` (which handles backslash escaping). These are isolated, reusable string and file operations that could be used in any C project. The tokenization function is particularly well-crafted for parsing command arguments with escape sequences.
A shell script that provides reusable test helpers for X11 window manager testing. It uses `bspc subscribe -f -c 1` to create a FIFO-based synchronization mechanism, allowing tests to wait for specific events (e.g., window creation) before proceeding. This pattern is novel and can be adapted to test any X11 window manager that supports event subscriptions, demonstrating a clean approach to race-condition-free testing in a GUI environment.