# switch displays
alt - 1 : yabai -m display --focus 1
alt - 2 : yabai -m display --focus 2

# switch to next space
alt - tab : yabai -m display --focus next || yabai -m display --focus first

# create new space
cmd - o : yabai -m space --create && \
          index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')" && \
          yabai -m space --focus "${index}"
# cmd - p : yabai -m space --destroy # Doesn't work

# switch spaces
cmd - 1 : yabai -m space --focus 1
cmd - 2 : yabai -m space --focus 2
cmd - 3 : yabai -m space --focus 3
cmd - 4 : yabai -m space --focus 4
cmd - 5 : yabai -m space --focus 5
cmd - 6 : yabai -m space --focus 6
cmd - 7 : yabai -m space --focus 7
cmd - 8 : yabai -m space --focus 8
cmd - 9 : yabai -m space --focus 9

# switch to next space
cmd - tab : yabai -m space --focus next || yabai -m space --focus first

# move spaces
alt - h : yabai -m space --display 1 && yabai -m space --focus 1 && yabai -m space --focus next
alt - l : yabai -m space --display 2 && yabai -m space --focus 2 && yabai -m space --focus next

# switch windows
cmd - up : yabai -m window --focus north
cmd - right : yabai -m window --focus east
cmd - down : yabai -m window --focus south
cmd - left : yabai -m window --focus west

cmd - k : yabai -m window --focus north
cmd - l : yabai -m window --focus east
cmd - j : yabai -m window --focus south
cmd - h : yabai -m window --focus west

# move windows
cmd + shift - up : yabai -m window --warp north
cmd + shift - right : yabai -m window --warp east
cmd + shift - down : yabai -m window --warp south
cmd + shift - left : yabai -m window --warp west

cmd + shift - k : yabai -m window --warp north
cmd + shift - l : yabai -m window --warp east
cmd + shift - j : yabai -m window --warp south
cmd + shift - h : yabai -m window --warp west

# move widows to other space
cmd + shift - 1 : yabai -m window --space 1
cmd + shift - 2 : yabai -m window --space 2
cmd + shift - 3 : yabai -m window --space 3
cmd + shift - 4 : yabai -m window --space 4
cmd + shift - 5 : yabai -m window --space 5

# toggle full screen windows
cmd - s : yabai -m window --toggle zoom-fullscreen

# toogle floating windows
cmd - d : yabai -m window --toggle float

# open new terminal
cmd - return : osascript -e 'tell application "iterm" to activate' -e 'tell application "system events" to tell process "iterm" to keystroke "n" using command down'

