Configs2026年5月20日·1 分钟阅读

bspwm — Tiling Window Manager Based on Binary Space Partitioning

bspwm is a tiling window manager for X11 that arranges windows using a binary tree structure. It is controlled entirely through messages via bspc, making it fully scriptable and highly customizable. Combined with sxhkd for keybindings, it offers a minimal yet powerful desktop workflow.

Agent 就绪

这个资产可以被 Agent 直接读取和安装

TokRepo 同时提供通用 CLI 命令、安装契约、metadata JSON、按适配器生成的安装计划和原始内容链接,方便 Agent 判断适配度、风险和下一步动作。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
bspwm Overview
通用 CLI 安装命令
npx tokrepo install 5264d9ef-5404-11f1-9bc6-00163e2b0d79

Introduction

bspwm is a minimalist tiling window manager that represents windows as leaves of a binary tree. Created by Bastien Dejean, it separates window management from input handling — bspwm manages the layout while sxhkd (Simple X Hotkey Daemon) handles keyboard shortcuts. All interaction happens through the bspc command, making every aspect of the window manager scriptable from the shell.

What bspwm Does

  • Arranges windows in a binary tree layout that splits the screen recursively
  • Controls all window operations through the bspc CLI command
  • Supports multiple monitors with independent desktops per monitor
  • Provides tiling, floating, and fullscreen modes per window
  • Integrates with sxhkd for user-defined keyboard shortcuts

Architecture Overview

bspwm models each desktop as a binary tree where internal nodes represent splits (horizontal or vertical) and leaf nodes represent windows. When a new window opens, it splits the focused leaf. The bspc command communicates with bspwm over a Unix socket, sending commands like bspc node -f west (focus the window to the left) or bspc node -s east (swap with the window to the right). External rules match windows by class or title and assign them to specific desktops or set them as floating.

Self-Hosting & Configuration

  • Configure bspwm via ~/.config/bspwm/bspwmrc — a shell script that runs on startup
  • Define keybindings in ~/.config/sxhkd/sxhkdrc using a simple syntax
  • Set window gaps, border width, and colors with bspc config commands
  • Write window rules with bspc rule -a ClassName desktop=^3 state=floating
  • Use a status bar like polybar or lemonbar, reading bspwm state via bspc subscribe

Key Features

  • Pure separation of concerns — bspwm handles layout, sxhkd handles input, polybar handles status
  • Fully scriptable via bspc — automate layouts, window placement, and desktop switching from shell scripts
  • Binary tree layout enables intuitive recursive splitting with manual resize and rotation
  • Per-window rules for automatic desktop assignment, floating state, and focus behavior
  • EWMH compliance for compatibility with panels, compositors, and desktop utilities

Comparison with Similar Tools

  • i3 — manual tiling with a built-in IPC and config language; bspwm uses a cleaner separation of concerns via bspc and sxhkd
  • dwm — source-code-configured tiling WM; bspwm is configured via shell scripts without recompilation
  • Hyprland — Wayland-native compositor with animations; bspwm is X11-only but lighter and more scriptable
  • Awesome WM — Lua-configured tiling WM; bspwm is simpler with its shell-based approach

FAQ

Q: Is bspwm good for beginners to tiling WMs? A: The learning curve is moderate. Copy the example configs, learn a few bspc commands, and customize incrementally.

Q: Does bspwm work with Wayland? A: No. bspwm is X11-only. For a similar approach on Wayland, consider Sway or River.

Q: How do I add a status bar? A: Use polybar or lemonbar. Subscribe to bspwm events with bspc subscribe to update the bar dynamically.

Q: Can I use bspwm with a compositor for transparency and shadows? A: Yes. Pair it with picom (formerly compton) for compositing effects.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产