#!/usr/bin/env sh

yabai -m signal --add event=dock_did_restart action="sudo yabai --load-sa"
sudo yabai --load-sa

# global settings
yabai -m config                                 \
    external_bar                 all:27:0       \
    menubar_opacity              1.0            \
    mouse_follows_focus          off            \
    focus_follows_mouse          off            \
    display_arrangement_order    default        \
    window_origin_display        default        \
    window_placement             second_child   \
    window_zoom_persist          on             \
    window_shadow                on             \
    window_animation_duration    0.0            \
    window_animation_easing      ease_out_circ  \
    window_opacity               off            \
    insert_feedback_color        0xffd75f5f     \
    split_ratio                  0.50           \
    split_type                   auto           \
    auto_balance                 off            \
    top_padding                  08             \
    bottom_padding               08             \
    left_padding                 08             \
    right_padding                08             \
    window_gap                   08             \
    layout                       bsp            \
    mouse_modifier               alt            \
    mouse_action1                move           \
    mouse_action2                resize         \
    mouse_drop_action            swap


yabai -m rule --add app="^System Settings$" manage=off
yabai -m rule --add app="^Calculator$" manage=off
yabai -m rule --add app="^Finder$" manage=off
yabai -m rule --add app="^Preview$" manage=off
yabai -m rule --add app="^Spotify$" manage=off
yabai -m rule --add app="^Safari$" manage=off
yabai -m rule --add app="^App Store$" manage=off
yabai -m rule --add app="^Activity Monitor$" manage=off
yabai -m rule --add label="Software Update" title="Software Update" manage=off
yabai -m rule --add app="System Information" manage=off

borders active_color=0xff82cfff inactive_color=0xff494d64 width=4.0 &

echo "yabai configuration loaded.."
