bspwm (binary space partitioning window manager) is a tiling window manager for the X Window System that arranges every window as a leaf of a binary tree, splitting the screen into nested halves. On the Linux desktop, bspwm is known for doing one job only: it manages windows and responds to messages, while keyboard shortcuts, panels and wallpapers are left to separate programs.
This minimalism makes bspwm a favorite of users who build their own environment from small parts, but it also means that a fresh installation shows no bar, no menu and no key bindings until the user configures them.
How binary space partitioning arranges windows
bspwm represents each desktop as a full binary tree in which internal nodes describe a split and leaf nodes hold windows. Every internal node records a split direction (vertical or horizontal) and a split ratio, typically 0.5, so the two children share the parent area in that proportion.
When a new window opens, bspwm chooses the focused leaf, replaces it with an internal node and places the old and new windows as its two children. This is why the layout grows as a spiral of halves, quarters and eighths unless the user changes the insertion rule.
The table below summarizes the insertion schemes that control where new windows go.
| Scheme | How the split is chosen | Resulting layout |
|---|---|---|
| Longest side | Split along the longer edge of the focused window | Balanced, roughly square tiles |
| Alternate | Alternate vertical and horizontal splits | Regular spiral pattern |
| Spiral | Rotate the tree on each insertion | Fibonacci-like spiral |
| Manual preselection | User picks a direction before opening the window | Exact placement chosen per window |
Because the layout is a tree, operations such as rotating, flipping, balancing and swapping subtrees apply to whole groups of windows at once, which is more expressive than the fixed layouts of many other tilers.
The bspc client and sxhkd key daemon
bspwm is controlled entirely through bspc, a command-line client that sends messages to the window manager over a Unix domain socket. Every action, from focusing a window to changing gaps, is a bspc command, so any script or program can drive the window manager.
Keyboard shortcuts are handled by sxhkd (simple X hotkey daemon), a separate program that maps key chords to shell commands. The configuration is therefore split across a few small files, as shown below.
| Component | Role | Usual location |
|---|---|---|
| bspwm | Manages window placement and the tree | Started by the display manager or xinit |
| bspwmrc | Executable startup script of bspc commands | ~/.config/bspwm/bspwmrc |
| bspc | Client that sends commands and queries | Called from scripts and sxhkd |
| sxhkd | Translates key chords into commands | ~/.config/sxhkd/sxhkdrc |
| Panel | Shows desktops and status, often polybar or lemonbar | Started from bspwmrc |
The bspwmrc file is an ordinary shell script, so settings such as bspc config window_gap 12 or bspc monitor -d I II III IV are simply commands executed at startup. Window rules, for example floating a dialog by its class name, use bspc rule -a.
The bspc subscribe command streams events such as focus changes and new nodes, which allows panels and custom scripts to react instantly without polling.
bspwm compared with other tiling window managers
bspwm belongs to the family of manual and dynamic tilers alongside i3, dwm, Sway and Hyprland. The main differences lie in the layout model, the configuration method and the display protocol.
The comparison below shows where bspwm sits among its closest neighbors.
| Window manager | Layout model | Configuration | Display protocol |
|---|---|---|---|
| bspwm | Binary tree of splits | Shell script plus sxhkd | X11 |
| i3 | Tree of containers with tabs and stacks | Single text file | X11 |
| dwm | Fixed master and stack layouts | C source, recompiled | X11 |
| Sway | i3-compatible container tree | i3-style text file | Wayland |
| Hyprland | Dynamic tiling with animations | Own text format | Wayland |
The key distinction is that bspwm has no built-in key handling or tabbed containers: what i3 offers in one file, bspwm splits into cooperating programs. Users who prefer tabs often choose i3, while those who want a scriptable, purely tree-based model choose bspwm.
Window states, desktops and multi-monitor behavior
Each window in bspwm has a state that decides whether it participates in tiling. A window can be tiled, pseudo-tiled, floating or fullscreen, and it can also carry flags such as sticky, locked or private.
- Tiled windows fill their leaf area completely.
- Pseudo-tiled windows keep their preferred size but stay centered within their leaf.
- Floating windows leave the tree and can be moved freely, which suits dialogs.
- Fullscreen windows cover the whole monitor while keeping their place in the tree.
Desktops belong to monitors, not to the whole screen, so each output has its own set of desktops, which bspwm detects through RandR. Moving a desktop between monitors is a single bspc command.
Limitations and common setup mistakes
The most important limitation is that bspwm is an X11-only window manager. It does not run as a Wayland compositor, so users who move to Wayland must switch to Sway, Hyprland or a similar project and rebuild their configuration.
Most early problems come from configuration rather than bugs, and the table below lists the typical cases.
| Symptom | Likely cause | Fix |
|---|---|---|
| Black screen, no shortcuts | sxhkd not started | Launch sxhkd from bspwmrc |
| Settings ignored | bspwmrc not executable | Set the executable permission |
| Java windows blank | Non-reparenting window manager | Set the AWT non-reparenting variable |
| Duplicate panels after reload | Panel started again on restart | Kill old instances before launching |
A plain-language summary
bspwm is a program that arranges windows on a Linux screen automatically. Instead of letting windows overlap like papers on a desk, it cuts the screen in half for each new window, then cuts one half again, and so on, so every window gets its own tile.
It is deliberately small. It does not include shortcuts, menus or a taskbar, so you assemble those pieces yourself. That takes effort at first, but it gives people who like to customize their computer exact control over how it looks and behaves.
An example from practice
A software developer uses a laptop with Arch Linux and an external 27-inch monitor. She wants an editor, a terminal and documentation visible at the same time without dragging windows around all day.
Her bspwmrc defines five desktops per monitor, a window gap of 10 pixels and a rule that makes the password manager float. In sxhkd she binds Super plus arrow keys to preselect a split direction and Super plus Return to open a terminal, so a new terminal appears exactly below the editor in a 60 and 40 percent split.
A small script subscribed to bspc events updates her panel with the current desktop. When she unplugs the monitor, its desktops move to the laptop screen automatically, and the result is a keyboard-driven workspace she can rebuild on a new machine by copying three configuration files.