Skip to content

Instantly share code, notes, and snippets.

@evwltrs
Created March 20, 2024 12:08
Show Gist options
  • Save evwltrs/821be5f277998ba4d9cdc2611c62d0ca to your computer and use it in GitHub Desktop.
Save evwltrs/821be5f277998ba4d9cdc2611c62d0ca to your computer and use it in GitHub Desktop.
Yabai smart-gaps. No padding if window count >= 2.
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