Created
March 20, 2024 12:08
-
-
Save evwltrs/821be5f277998ba4d9cdc2611c62d0ca to your computer and use it in GitHub Desktop.
Yabai smart-gaps. No padding if window count >= 2.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
padding_refresh_command="p=\$((\$(yabai -m query --windows --space | jq 'length') == 1 ? 0 : 12)) && \ | |
yabai -m config --space mouse top_padding \$p && \ | |
yabai -m config --space mouse bottom_padding \$p && \ | |
yabai -m config --space mouse left_padding \$p && \ | |
yabai -m config --space mouse right_padding \$p" | |
yabai -m signal --add event=window_created action="$padding_refresh_command" | |
yabai -m signal --add event=window_destroyed action="$padding_refresh_command" | |
yabai -m signal --add event=application_launched action="$padding_refresh_command" | |
yabai -m signal --add event=application_terminated action="$padding_refresh_command" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment