LinuxCommandLibrary

bspc

Manage windows in a binary space partitioning

TLDR

Define two virtual desktops

$ bspc monitor [[-d|--reset-desktops]] [desktop_name1] [desktop_name2]
copy

Focus the given desktop
$ bspc desktop [[-f|--focus]] [number]
copy

Close the windows rooted at the selected node
$ bspc node [[-c|--close]]
copy

Send the selected node to the given desktop
$ bspc node [[-d|--to-desktop]] [number]
copy

Toggle full screen mode for the selected node
$ bspc node [[-t|--state]] ~fullscreen
copy

Set the value of a specific setting
$ bspc config [setting_name] [value]
copy

SYNOPSIS

bspc [-h] [-v] [-p path] [-s path] [-P] [-l level] [-L] [-d id] [-D] command [args …]

PARAMETERS

-h
    Print usage information and exit

-v
    Print version information and exit

-p path
    Set primary socket path (default: $BSPWM_SOCKET or /tmp/bspwm_$USER_0)

-s path
    Set secondary socket path (default: $BSPWM_SOCKET_SOCK or /tmp/bspwm_$USER_1)

-P
    Print primary socket path and exit

-l level
    Set subscribe log level (debug, info, warn, error; default: info)

-L
    List available log levels

-d id
    Set default desktop identifier

-D
    List existing desktop identifiers

DESCRIPTION

bspc is the primary control tool for bspwm, a lightweight, highly configurable tiling window manager for X11 that uses binary space partitioning (BSP).

bspwm divides the screen into monitors, desktops, and nodes (windows), and bspc sends IPC messages over Unix sockets to query states, configure settings, manage layouts, focus elements, and subscribe to events.

Common workflows include scripting keybindings (often with sxhkd) for actions like switching desktops (bspc desktop -f next), toggling window states (bspc node -t tiled), or querying focused window (bspc query -N -n focused).

It supports targeting specific monitors/desktops/nodes via selectors like -m ^1 (monitor 1), @1 (desktop 1), or focused. Configuration keys like border_width or window_gap are set dynamically.

bspc enables dynamic, rule-based window management without restarting the WM, ideal for minimalistic setups.

CAVEATS

Requires a running bspwm instance with matching socket paths. Some actions need X11 access; selectors must be valid or operations fail silently. Not for Wayland.

MAIN SUBCOMMANDS

config: Set/query keys (e.g., border_width).
desktop: Focus/layout desktops.
monitor: Assign/move monitors.
node: Manage windows (focus, state, stack).
query: Output selectors (JSON/tree).
rule: Add/remove rules.
subscribe: Event stream.
wm: Quit/restart.

EXAMPLES

bspc monitor -d I II III: Assign desktops to focused monitor.
bspc node @/focused -f: Focus window on current desktop.
bspc subscribe report: Stream layout events.

HISTORY

Developed by Bastien De Cae as part of bspwm project. First release ~2012; major v0.9 in 2014 introduced bspc IPC overhaul. Actively maintained on GitHub (0.6.x series as of 2024), popular in ricing communities.

SEE ALSO

bspwm(1), sxhkd(1)

Copied to clipboard