]> git.lizzy.rs Git - bspwm.git/blobdiff - README.md
Add new setting: automatic_scheme
[bspwm.git] / README.md
index a4e586bc7ff1eefad6513c1dceb82af7d5fe37b8..a5d0cd5920bfce3aba1b12e85118569210622db6 100644 (file)
--- a/README.md
+++ b/README.md
@@ -51,49 +51,7 @@ When *bspwm* receives a new window, it inserts it into a window tree at the spec
 
 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.
+By default the insertion point is the focused window and its insertion mode is *automatic*.
 
 ### Manual Mode
 
@@ -103,7 +61,7 @@ The *DIR* argument allows to specify how the insertion point should be split (ho
 
 After doing so the insertion point goes into *manual* mode.
 
-For example, let's consider the following scenario:
+Let's consider the following scenario:
 
 ```
             a                          a                          a
@@ -138,6 +96,86 @@ 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.
 
+### Automatic Mode
+
+The *automatic* mode, as opposed to the *manual* mode, doesn't require any user choice. The way the new window is inserted is determined by the value of the automatic scheme and the initial polarity settings.
+
+#### Longest side
+
+When the value of the automatic scheme is `longest_side`, the window will be attached as if the insertion point was in manual mode and the split direction was choosen based on the dimensions of the tiling rectangle and the initial polarity.
+
+Let's consider the following scenario, where the initial polarity is set to `second_child`:
+
+```
+             1                          a                          a
+             ^                         / \                        / \
+                         --->         1   2         --->         1   b
+                                          ^                         / \
+                                                                   2   3
+                                                                       ^
+
+ +-----------------------+  +-----------------------+  +-----------------------+
+ |                       |  |           |           |  |           |           |
+ |                       |  |           |           |  |           |     2     |
+ |                       |  |           |           |  |           |           |
+ |           1           |  |     1     |     2     |  |     1     |-----------|
+ |           ^           |  |           |     ^     |  |           |           |
+ |                       |  |           |           |  |           |     3     |
+ |                       |  |           |           |  |           |     ^     |
+ +-----------------------+  +-----------------------+  +-----------------------+
+
+             X                          Y                          Z
+```
+
+In state *X*, a new window is added.
+
+Since *1* is wide, it gets split vertically and *2* is added as *a*'s second child given the initial polarity.
+
+This leads to *Y* where we insert window *3*. *2* is tall and is therefore split horizontally. *3* is once again added as *b*'s second child.
+
+#### Spiral
+
+When the value of the automatic scheme is `spiral`, the window will *take the space* of the insertion point.
+
+Let's dive into the details with 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 *spiral* automatic scheme generates window spirals that rotate clockwise (resp. anti-clockwise) if the insertion point is the first (resp. second) child of its parent.
+
+
 ## Supported protocols and standards
 
 - The RandR and Xinerama protocols.