No description
Find a file
2016-05-28 09:43:05 +02:00
contrib Add setting: pointer_motion_interval 2016-05-28 09:43:05 +02:00
doc Add setting: pointer_motion_interval 2016-05-28 09:43:05 +02:00
examples Remove setting: history_aware_focus 2016-04-28 10:33:30 +02:00
tests Fix ID format in test window 2016-03-29 12:33:28 +02:00
.gitignore Generalize window commands to nodes 2015-12-22 19:25:45 +01:00
bspc.c Fail verbosely 2016-03-21 14:28:04 +01:00
bspwm.c Set the WM_NAME property of each monitor's root 2016-05-18 21:13:27 +02:00
bspwm.h Implement focus_follows_pointer via enter_notify 2016-04-15 19:11:30 +02:00
common.h Fail verbosely 2016-03-21 14:28:04 +01:00
desktop.c Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
desktop.h Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
events.c Remove unnecessary headers 2016-04-21 11:19:11 +02:00
events.h Implement focus_follows_pointer via enter_notify 2016-04-15 19:11:30 +02:00
ewmh.c Reinstate built-in pointer bindings 2016-04-07 18:08:32 +02:00
ewmh.h Reinstate built-in pointer bindings 2016-04-07 18:08:32 +02:00
geometry.c Fix gcc warnings 2016-05-06 10:10:27 +02:00
geometry.h Remove setting: history_aware_focus 2016-04-28 10:33:30 +02:00
helpers.c Close file descriptor in read_string 2016-05-14 17:56:34 +02:00
helpers.h Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
history.c Remove setting: history_aware_focus 2016-04-28 10:33:30 +02:00
history.h Remove setting: history_aware_focus 2016-04-28 10:33:30 +02:00
jsmn.c Generalize window commands to nodes 2015-12-22 19:25:45 +01:00
jsmn.h Use JSON as the output format of query -T 2015-11-22 14:41:00 +01:00
LICENSE Use generic BSD 2-clause license 2014-10-22 11:53:03 +02:00
Makefile Add fish shell completion. 2016-05-11 16:59:01 -05:00
messages.c Add setting: pointer_motion_interval 2016-05-28 09:43:05 +02:00
messages.h Reinstate built-in pointer bindings 2016-04-07 18:08:32 +02:00
monitor.c Fix null pointer dereference in restore_tree 2016-05-22 16:56:07 +02:00
monitor.h Set the WM_NAME property of each monitor's root 2016-05-18 21:13:27 +02:00
parse.c Provide a way to disable built-in pointer bindings 2016-05-21 21:31:14 +02:00
parse.h Reinstate built-in pointer bindings 2016-04-07 18:08:32 +02:00
pointer.c Add setting: pointer_motion_interval 2016-05-28 09:43:05 +02:00
pointer.h Only grab what needs to be grabbed 2016-04-11 20:26:48 +02:00
query.c Provide a way to disable built-in pointer bindings 2016-05-21 21:31:14 +02:00
query.h Add node modifiers: {descendant,ancestor}_of 2016-05-09 16:55:31 +02:00
README.md Generalize window commands to nodes 2015-12-22 19:25:45 +01:00
restore.c Set the WM_NAME property of each monitor's root 2016-05-18 21:13:27 +02:00
restore.h Fail verbosely 2016-03-21 14:28:04 +01:00
rule.c Provide computed selectors for the external rules 2016-05-24 16:32:40 +02:00
rule.h Generalize window commands to nodes 2015-12-22 19:25:45 +01:00
settings.c Add setting: pointer_motion_interval 2016-05-28 09:43:05 +02:00
settings.h Add setting: pointer_motion_interval 2016-05-28 09:43:05 +02:00
Sourcedeps Generalize window commands to nodes 2015-12-22 19:25:45 +01:00
stack.c Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
stack.h Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
subscribe.c Reinstate built-in pointer bindings 2016-04-07 18:08:32 +02:00
subscribe.h Add event: monitor_swap 2016-02-01 11:46:03 +01:00
tree.c Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
tree.h Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
types.h Provide a way to disable built-in pointer bindings 2016-05-21 21:31:14 +02:00
VERSION Version 0.9.1 2016-03-15 10:14:20 +01:00
window.c Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00
window.h Don't show presel feedbacks for the monocle layout 2016-05-16 10:33:22 +02:00

Description

bspwm is a tiling window manager that represents windows as the leaves of a full binary tree.

It only responds to X events, and the messages it receives on a dedicated socket.

bspc is a program that writes messages on bspwm's socket.

bspwm doesn't handle any keyboard or pointer inputs: a third party program (e.g. sxhkd) is needed in order to translate keyboard and pointer events to bspc invocations.

The outlined architecture is the following:

        PROCESS          SOCKET
sxhkd  -------->  bspc  <------>  bspwm

Configuration

The default configuration file is $XDG_CONFIG_HOME/bspwm/bspwmrc: this is simply a shell script that calls bspc.

Keyboard and pointer bindings are defined with sxhkd.

Example configuration files can be found in the examples directory.

Monitors, desktops and windows

bspwm holds a list of monitors.

A monitor is just a rectangle that contains desktops.

A desktop is just a pointer to a tree.

Monitors only show the tree of one desktop at a time (their focused desktop).

The tree is a partition of a monitor's rectangle into smaller rectangular regions.

Each node in a tree either has zero or two children.

Each internal node is responsible for splitting a rectangle in half.

A split is defined by two parameters: the type (horizontal or vertical) and the ratio (a real number r such that 0 < r < 1).

Each leaf node holds exactly one window.

Insertion Modes

Prelude

When bspwm receives a new window, it inserts it into a window tree at the specified insertion point (a leaf) using the insertion mode specified for that insertion point.

The insertion mode tells bspwm how it should alter the tree in order to insert new windows on a given insertion point.

By default the insertion point is the focused window and its default insertion mode is automatic.

Automatic Mode

The automatic mode, as opposed to the manual mode, doesn't require any user choice: the new window will take the space of the insertion point.

For example, let's consider the following scenario:

             a                          a                          a
            / \                        / \                        / \
           1   b         --->         1   c         --->         1   d
              / \                        / \                        / \
             2   3                      4   b                      5   c
             ^                          ^  / \                     ^  / \
                                          3   2                      b   4
                                                                    / \ 
                                                                   3   2

 +-----------------------+  +-----------------------+  +-----------------------+
 |           |           |  |           |           |  |           |           |
 |           |     2     |  |           |     4     |  |           |     5     |
 |           |     ^     |  |           |     ^     |  |           |     ^     |
 |     1     |-----------|  |     1     |-----------|  |     1     |-----------|
 |           |           |  |           |     |     |  |           |  3  |     |
 |           |     3     |  |           |  3  |  2  |  |           |-----|  4  |
 |           |           |  |           |     |     |  |           |  2  |     |
 +-----------------------+  +-----------------------+  +-----------------------+

              X                         Y                          Z 

In state X, the insertion point, 2 is in automatic mode.

When we add a new window, 4, the whole tree rooted at b is reattached, as the second child of a new internal node, c.

The splitting parameters of b (type: horizontal, ratio: ½) are copied to c and b is rotated by 90° clockwise.

The tiling rectangle of 4 in state Y is equal to the tiling rectangle of 2 in state X.

Then the insertion of 5, with 4 as insertion point, leads to Z.

The automatic mode generates window spirals that rotate clockwise (resp. anti-clockwise) if the insertion point is the first (resp. second) child of its parent.

Manual Mode

The user can specify a region in the insertion point where the next new window should appear by sending a node -p|--presel-dir DIR message to bspwm.

The DIR argument allows to specify how the insertion point should be split (horizontally or vertically) and if the new window should be the first or the second child of the new internal node (the insertion point will become its brother).

After doing so the insertion point goes into manual mode.

For example, let's consider the following scenario:

            a                          a                          a
           / \                        / \                        / \
          1   b         --->         c   b         --->         c   b
          ^  / \                    / \ / \                    / \ / \
            2   3                  4  1 2  3                  d  1 2  3
                                   ^                         / \
                                                            5   4
                                                            ^

+-----------------------+  +-----------------------+  +-----------------------+
|           |           |  |           |           |  |     |     |           |
|           |     2     |  |     4     |     2     |  |  5  |  4  |     2     |
|           |           |  |     ^     |           |  |  ^  |     |           |
|     1     |-----------|  |-----------|-----------|  |-----------|-----------|
|     ^     |           |  |           |           |  |           |           |
|           |     3     |  |     1     |     3     |  |     1     |     3     |
|           |           |  |           |           |  |           |           |
+-----------------------+  +-----------------------+  +-----------------------+

            X                          Y                          Z 

In state X, the insertion point is 1.

We send the following message to bspwm: node -p north.

Then add a new window: 4, this leads to state Y: the new internal node, c becomes a's first child.

Finally we send another message: node -p west and add window 5.

The ratio of the preselection (that ends up being the ratio of the split of the new internal node) can be changed with the node -o|--presel-ratio message.

Supported protocols and standards

  • The RandR and Xinerama protocols.
  • A subset of the EWMH and ICCCM standards.