Adjust width of focused window with keyboard #1964
dungle-scrubs
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
You can use a combination of skhd and yabai's built in window resizing commands. Here's my skhd config that resizes the master window with
|
Beta Was this translation helpful? Give feedback.
1 reply
-
@bustinbung thanks for the awesome script! I wanted to simplify it a bit and came up with the following: #!/bin/bash
WINDOW_RESIZE_AMOUNT=100
WINDOW=$(yabai -m query --windows --window)
SPLIT_TYPE=$(echo $WINDOW | jq -r '."split-type"')
resize() {
if [[ $SPLIT_TYPE == "vertical" ]]; then
echo "right:$1$WINDOW_RESIZE_AMOUNT:0"
else
echo "bottom:0:$1$WINDOW_RESIZE_AMOUNT"
fi
}
if [[ $1 = "decrease" ]]; then
yabai -m window --resize $(resize "-")
elif [[ $1 = "increase" ]]; then
yabai -m window --resize $(resize "")
else
echo "Invalid flag entered."
fi I call it from Alfred with However, I noticed that using it makes Yabai sluggish…do you see anything wrong with the script or do you think I should look elsewhere? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've just started using yabai and am really liking it so far. In my efforts to go mouseless, I find the urge to use my keyboard arrows plus a modifier to change the width of the window in focus by a few % per tap. Often, when I toss two windows on the screen at 50% each, I quickly realize the ideal percentages are a little different and want to quickly adjust, so I need to reach over for the mouse and drag.
Is this something that can currently be done? Or perhaps it would be a good feature candidate?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions