Bspwm: Breadth first automatic mode

Created on 15 Oct 2017  路  5Comments  路  Source: baskerville/bspwm

I found very uncomfortable bspwm's clockwise spiral automatic mode (which is, I think, depth first search) .
I want to suggest:
1) Implement option to choose between automatic mode algorithms
2) Breadth first automatic mode, which instead of making spiral will fill screen with behavior like this:

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

All 5 comments

@neeasade I would also be interested in a breadth-first approach (as @KGOH suggested). It just makes more sense to me. So you are saying that the link you posted does exactly that? How can I trigger it? As usual, documentation is scarce and for non expert users it is difficult to wrap your head around it.

Tangentially, I would also be interested in a mode designed for ultra-widescreen monitors, with three columns:

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

@alecive, I鈥檓 agree what it isn鈥檛 obvious how to enable that external rule. I did not even find documentation about it.

You can make three columns layout by doing this in manual mode:
(assuming, what your sxhkd has these config, and no windows open on currend desktop).

  • super + enter (new terminal window)
  • ctrl + alt + l (preselect east)
  • super + enter (new terminal window)
  • ctrl + alt + l (preselect east)
  • super + enter (new terminal window)
  • in terminal execute: bspc node @/ --balance (make split ratios balanced)

Now you have:

 |       |       |       |
 |       |       |       |
 |       |       |       |
 |   1   |   2   |   3   |
 |       |       |       |
 |       |       |       |
 |       |       |       |
 +-----------------------+
  • super + h (focus to the west)
  • super + h (focus to the west)
  • ctrl + alt + j (preselect south)
  • super + enter (new terminal window)
  • super + shift + l (swap east)

Now you have:

|       |       |       |
|   1   |       |       |
|       |       |       |
|-------|   4   |   3   |
|       |       |       |
|   2   |       |       |
|       |       |       |
+-----------------------+
  • super + l (focus to the east)
  • ctrl + alt + j (preselect south)
  • super + enter (new terminal window)
  • super + shift + h (swap west)

Now you have:

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

Thanks @KGOH for the great tutorial! Now what I would like to do is to have it automatically enabled every time I open bspwm.

That is what external_rules allow you to do. From the external rules script you can query the state/current layout, and then make decisions about current node placement (by printing out rule property pairs).The script in the example folder only checks current size of the focused node, and then opens to the left or down (you don't have to specify presel/it is automatic, as @alecive highlights).

The rule property pairs you can control via external rules are:

[monitor=MONITOR_SEL|desktop=DESKTOP_SEL|node=NODE_SEL] [state=STATE] [layer=LAYER] 
[split_dir=DIR] [split_ratio=RATIO] [(locked|sticky|private|center|follow|manage|focus|border)=(on|off)]

So, on launch/new window, you can control any of the above.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kristoferus75 picture kristoferus75  路  4Comments

alecive picture alecive  路  7Comments

Fnux picture Fnux  路  4Comments

icf20 picture icf20  路  5Comments

ortango picture ortango  路  3Comments