Yabai: Question: is it possible to auto-stack new windows?

Created on 28 Sep 2020  路  2Comments  路  Source: koekeishiya/yabai

Hello,

Fisrt off, that you for making yabai and being so incredibly helpful to those who use it. it's appreciated :)

Is it possible to configure (on a per-space basis or globally) a rule like yabai -m window --insert stack, so that new windows created in that space automatically stack onto the most recent window?

My use case is that I really like stacks, but i also really like bsp layout and the ability to have more than one stack in a given space.
If i set the layout of a space to bsp, i can have multiple stacks but all new windows cause splits
If i set the layout of a space to stack, all new windows stack, but it's no longer possible to split a stack and have multiple stacks

I'm stuck on this one. Any advice or direction would be greatly appreciated

question

Most helpful comment

You can cause the next insertion to happen in stack mode on the focused window whenever the focused window changes:

yabai -m signal --add event=window_focused action='yabai -m window $YABAI_WINDOW_ID --insert stack'
yabai -m signal --add event=application_front_switched action='yabai -m window --insert stack'

You can hide the insertion overlay by setting the config option insert_feedback_color.

yabai -m config insert_feedback_color 0x00FFFFFF

All 2 comments

You can cause the next insertion to happen in stack mode on the focused window whenever the focused window changes:

yabai -m signal --add event=window_focused action='yabai -m window $YABAI_WINDOW_ID --insert stack'
yabai -m signal --add event=application_front_switched action='yabai -m window --insert stack'

You can hide the insertion overlay by setting the config option insert_feedback_color.

yabai -m config insert_feedback_color 0x00FFFFFF

awesome, thank you!

That's almost perfect

The only time it fails is if you close a window and create a new one. I added

yabai -m signal --add event=application_terminated action='yabai -m window --insert stack'
yabai -m signal --add event=window_destroyed action='yabai -m window --insert stack'

and now it's working great.

Thank you so much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brentd picture brentd  路  4Comments

ThiagoFacchini picture ThiagoFacchini  路  4Comments

fuckbitchesgitmoney picture fuckbitchesgitmoney  路  4Comments

danijar picture danijar  路  4Comments

brorbw picture brorbw  路  4Comments