Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Reorganize the tree #171

Closed
wernight opened this issue Sep 9, 2014 · 9 comments
Closed

Reorganize the tree #171

wernight opened this issue Sep 9, 2014 · 9 comments

Comments

@wernight
Copy link

wernight commented Sep 9, 2014

I found myself often with a tree that doesn't look like what I want (for example two large horizontal wide windows on an already wide screen instead of two vertical ones).

However to change the tree structure I found it really difficult:

  1. Mod + Ctrl + h/j/k/l - Set where you want the child
  2. Mod + Enter - Create a new window there
  3. Drag & drop to that new terminal
  4. Close the terminal opened at step 2

Is there a simpler way? Something along like drag & drop on edges?

@baskerville
Copy link
Owner

bspc desktop -R 90 or the corresponding window command to only rotate a specific edge?

@wernight
Copy link
Author

Ah ha! Thank you.

I didn't expect rotate to do that. Thanks I'll set that up. Should that be in a wiki page? I wish I could see https://www.reddit.com/r/unixporn/comments/1m0ea1/arch_bspwm_why_bspwm_watch_this_screencast_and/ which sounds like the only cool demo video of BSPWM that existed (seems gone now).

@wernight
Copy link
Author

bspc destop -R 90 is working well for the entire desktop (all windows). Actually 90 is the only shortcut you really need (just repeat it 1x, 2, 3x), and possible 180 for mirror left/right.

bspc window -R {left|right|top|bottom} {90|180|-90} however gives what feels like random results. For example bspc window -R left 90 sometimes changes:

                                    | B
 A | B | C          –>           A  | —
                                    | C 

... and sometimes I get:

                                     A
                                     — 
 A | B | C          –>               B
                                     — 
                                     C 

... depending visibly if I've B or C selected. This is further more confusing that often I cannot rotate on some edges.

I found no sxhkdrc using it. The transformation above is however useful. It'd be most useful by a drag&drop (example drag C to bottom edge of B generates the first transform, the second is the desktop -R).

@anko
Copy link

anko commented Sep 26, 2014

I use i3 and this is the issue blocking me from switching to bspwm. I figured a visual example would help, so here:

Given a starting state

starting state

I want to move one of the stacked windows out into its own column on the right.

shot1

In i3, I would focus the window and press Mod4 + Shift + L, which is the default shortcut for move right. Windows moved this way reorganise the layout tree.

A similar operation in bspwm is possible with the right node movements and tree rotations, but often a confusing exercise. This is because understanding the underlying binary tree based on an arrangement of windows is easily complicated by manual split directions. For example, based on the above initial arrangement of windows, which of these trees is correct?

shot

It's ambiguous. The three-stack arrangement on the right could have happened through either the top or the bottom node being split vertically.

Once we do figure that out, which node do we choose to move or rotate, and in which direction? Am I rotating the binary tree or its visual representation? How does one map to the other? How do manual splits affect that mapping? How the heck do I just push this window to right there?

The documentation seems to assume I know all of these things (and I thought I did!). For now, I'll continue staring at the output of bspc query --tree, in the hope that something will click.

Am I missing something?

If someone can explain this to me, I'd be happy to make illustrations to help document it.

@baskerville
Copy link
Owner

@anko:

That's a valid complaint: there're many cases where it's impossible to know in advance what layout will produce a local rotation.

In you particular example, bspc window -w down && bspc window -R down 90 should work but is unintuitive.

If I manage to generalise window commands to internal tree nodes, the given example would be solved by preselecting right on the root node and by re-inserting the focused window on that node.

The graphics are very nice by the way.

@shanechin
Copy link

Is this something still being planned?

@baskerville
Copy link
Owner

It is, but I don't have too much time to work on bspwm right now.

@baskerville
Copy link
Owner

It is now possible (as of eb07d2f) to preselect internal nodes.

@alkeryn
Copy link

alkeryn commented Apr 19, 2017

sory for unburying but with good use of the node roatate fonction anko problem is solved in 3 step

What you can't solve with rotate however is when you have 4 nodes on default shape (fibonacci layout) and you want them to take a grid layout
tried to fix it with bspc -f @{west,south,north,west} in my sxhkb, didn't work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants