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

Feature Request: Option to alternate layouts when opening windows #228

Closed
paulodiovani opened this issue May 16, 2024 · 5 comments
Closed

Comments

@paulodiovani
Copy link

I want to be able to alternate layouts (vertical, horizontal, vertical...) when opening new windows, similar to what this i1 plugin do: https://github.com/olemartinorg/i3-alternating-layout

Is there a way to achieve this today?
If not, can we add as a feature request?

@nikitabobko
Copy link
Owner

Is there a way to achieve this today?

No, it's not possible yet

If not, can we add as a feature request?

Once the on-focus-changed callback is introduced #230 and the command to query the tree is introduced #16, it should be possible to implement a similar alternate layouts script

@paulodiovani
Copy link
Author

Another (even better) option would be to have a layout that prioritize a single window, always giving it the biggest piece of the screen.

Similar to Hyperland master layout or Amethyst tall layout

@cornz
Copy link

cornz commented Aug 16, 2024

This would be a great addition as I'm also very used to have a layout like this on my second monitor on all workspaces:
image

This works flawlessly by default on yabai and would be great to have on aerospace, too

@nikitabobko
Copy link
Owner

I'm closing this issue in favor of two others:

@paulodiovani
Copy link
Author

Hi again,
I got close to make this work with a keybinding.

Screen Recording 2024-09-04 at 16 43 59

I'm using exec-and-forget to count how many windows are opened to decide which if join-with should be called with up or left.

[mode.main.binding]
cmd-shift-h = 'join-with up'
cmd-shift-v = 'join-with left'
cmd-shift-e = '''exec-and-forget if [ $(expr $(aerospace list-windows --workspace focused | wc -l) % 2) -eq 0 ]; then
  aerospace join-with up;
else
  aerospace join-with left;
fi
'''

Of course, rely on window count is a terrible solution and will break if there are floating windows around, but I plan to rewrite this using tree when #16 is available.

I wanted to use with on-window-detected callback, but it does not accept exec-and-forget.

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

No branches or pull requests

3 participants