Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bspwm inspired <WINDOW_SEL>: parent, brother, first or second (child) #192

Closed
kiryph opened this issue Aug 4, 2019 · 2 comments
Closed
Labels
suggestion Request for new feature or some form of enhancement

Comments

@kiryph
Copy link

kiryph commented Aug 4, 2019

Currently yabai provides following window selections:

WINDOW_SEL  := prev | next | first | last | recent | mouse | largest | smallest | DIR_SEL | window id

The example configuration of bspwm lists following mappings

# focus the node for the given path jump
super + {p,b,comma,period}
	bspc node -f @{parent,brother,first,second}

IMHO they are a good fit for the layout bsp.

They also help the user to have the right picture of the underlying tree in his/her mind. Sometimes you forget which is a subnode of another which makes operations like changing the split type guess work. Consider following layout

+------------------+
|           |  W2  |
|           |      |
|           |------|
|     W1    |  W3  |
|           |      |
|           |------|
|           |  W4  |
|           |      |
+------------------+

Is W4 a subnode of W2 or W3? The picture on its own does not answer this.

Also operating on subtrees can be a powerful method to deal with several windows (e.g. closing). However, this would be a different issue.

Also a visual hint about the tree structure could be another feature request.

UPDATE

I think I understood the bsp concept not properly. Most importantly following two aspects were not clear to me:

  • Each node in a tree either has zero or two children.
  • Each leaf node holds exactly one window.

This means a window is always only a leave in the bsp tree, i.e. cannot be a parent or have children.

The possible trees for four windows are:

1)       a        2)     a
        / \             / \
       /   \           /   \
      b     c         W1    b
     / \   / \             / \
    W1 W2 W3 W4           W2  c
                             / \
                            W3 W4   

Note any permutation of W<i> is possible which again mean that you do not know which is the split partner.

I think this feature request could be changed to two requests:

  1. select window by uncle, brother, first and second nephew.
  2. add the possibility to focus nodes not only windows (draw border around all contained windows)
@koekeishiya
Copy link
Owner

add the possibility to focus nodes not only windows (draw border around all contained windows)

Focusing a node does not make sense, but I do agree that for example that closing all windows rooted at a given node could make sense. This sort of ties in to my reply in #190 where we have a separate domain to interact with nodes.

@koekeishiya koekeishiya added discussion Discussion suggestion Request for new feature or some form of enhancement labels Sep 3, 2019
@koekeishiya koekeishiya added addressed on master; not released Fixed upstream, but not yet released and removed discussion Discussion labels Sep 23, 2022
@koekeishiya
Copy link
Owner

Implemented sibling, first_nephew, second_nephew, uncle, first_cousin, second_cousin. Window queries will also include the attribute split-child: first/second_child(or none if not bsp-managed).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
suggestion Request for new feature or some form of enhancement
Projects
None yet
Development

No branches or pull requests

2 participants