Open dominiklohmann opened 8 months ago
I would consider that a bug. In fact it is caused by using a cached value of the window frame instead of requesting it from the AX API.
I'm not opposed to looking into adding a center "handle" to the resize command, but that will likely come at some other point in time. For now I'll just resolve the bug with your current method.
Awesome, thanks for the quick fix. I can confirm this works as expected now.
Fixed in v7.0.4. I'll keep this open as a suggestion for a new resize handle which may make this operation built-in in the future.
@dominiklohmann does this work for you on 7.0.4?
yabai -m query --windows id,frame --window |
jq -er '"yabai -m window \(.id) --toggle float --resize center:\(.frame.w/-20):\(.frame.h/-20)"' |
sh -
Or did you end up with a different syntax? The above doesn't work for me.
@Pe8er if you read the thread again you'll see that the center anchor was not implemented. Instead, the behavior for providing two resizes with different anchors at once was fixed, allowing you to achieve the same effect that a center anchor would have.
@dominiklohmann I see now, sorry for the oversight and thank you for clarification!
I've been trying to add an effect to toggling a window into floating mode to make it a bit more obvious, and for that I wanted to resize the window around its center.
I tried this:
But then I quickly noticed that it doesn't achieve what I wanted it to, as yabai ignores the first
--resize
I passed in. Not sure whether that should be considered a bug.From a user experience perspective, I don't actually want to express this as two resizes anchored at opposite corners. All I wanted to do is shrink my window by 20% around its center. It'd be nice to have a dedicated window command for this, for example:
Because then my script could just be this: