# $DOTFILES/platforms/mac/skhdrc
# Date: 2024-11-30
# Author: js0ny

# Location: $XDG_CONFIG_HOME/skhd/skhdrc
# Linking:
# ln -sf $DOTFILES/platforms/mac/skhdrc $XDG_CONFIG_HOME/skhd/skhdrc

# Navigation
fn - h : yabai -m window --focus west
fn - n : yabai -m window --focus south
fn - e : yabai -m window --focus north
fn - i : yabai -m window --focus east

# Moving windows
shift + fn - h : yabai -m window --warp west
shift + fn - n : yabai -m window --warp south
shift + fn - e : yabai -m window --warp north
shift + fn - i : yabai -m window --warp east

fn - 1 : yabai -m space --focus 1
fn - 2 : yabai -m space --focus 2
fn - 3 : yabai -m space --focus 3
fn - 4 : yabai -m space --focus 4
fn - 5 : yabai -m space --focus 5
fn - 6 : yabai -m space --focus 6
fn - 7 : yabai -m space --focus 7
fn - 8 : yabai -m space --focus 8
fn - 9 : yabai -m space --focus 9
fn - 0  : yabai -m space --focus 10

# minimize window
alt - m : yabai -m window --minimize

# float / unfloat window and center on screen
ctrl - f : yabai -m window --toggle float

# toggle window native fullscreen
shift + ctrl - f : yabai -m window --toggle native-fullscreen

# send window to a space
shift + fn - 1 : yabai -m window --space 1
shift + fn - 2 : yabai -m window --space 2
shift + fn - 3 : yabai -m window --space 3
shift + fn - 4 : yabai -m window --space 4
shift + fn - 5 : yabai -m window --space 5
shift + fn - 6 : yabai -m window --space 6
shift + fn - 7 : yabai -m window --space 7
shift + fn - 8 : yabai -m window --space 8
shift + fn - 9 : yabai -m window --space 9
shift + fn - 0 : yabai -m window --space 10

# open terminal
fn - r: wezterm-gui

# # moves focus between windows in the current focused display
# ctrl - h : yabai -m window --focus west
# ctrl - n : yabai -m window --focus south
# ctrl - e : yabai -m window --focus north
# ctrl - i : yabai -m window --focus east
#
# # moves focus between spaces
# cmd + ctrl + alt + shift - 1 : yabai -m space --focus 1
# cmd + ctrl + alt + shift - 2 : yabai -m space --focus 2
# cmd + ctrl + alt + shift - 3 : yabai -m space --focus 3
# cmd + ctrl + alt + shift - 4 : yabai -m space --focus 4
# cmd + ctrl + alt + shift - 5 : yabai -m space --focus 5
# cmd + ctrl + alt + shift - 6 : yabai -m space --focus 6
# cmd + ctrl + alt + shift - 7 : yabai -m space --focus 7
# cmd + ctrl + alt + shift - 8 : yabai -m space --focus 8
# cmd + ctrl + alt + shift - 9 : yabai -m space --focus 9
# cmd + ctrl + alt + shift - 0  : yabai -m space --focus 10
#
# # delete focused space
# cmd + ctrl + alt + shift - q : yabai -m space --destroy
#
# # toggle window split type
# alt - e : yabai -m window --toggle split
#
# # close window
# alt - x : yabai -m window --close
#
# # minimize window
# alt - m : yabai -m window --minimize
#
# # rotate tree
# alt - r : yabai -m space --rotate 90
#
# # mirror tree y-axis
# alt - y : yabai -m space --mirror y-axis
#
# # toggle desktop offset
# alt - a : yabai -m space --toggle padding; yabai -m space --toggle gap
#
# # toggle window parent zoom
# alt - d : yabai -m window --focus mouse && \
#           yabai -m window --toggle zoom-parent
#
# # float / unfloat window and center on screen
# alt - t : yabai -m window --toggle float;\
#           yabai -m window --grid 4:4:1:1:2:2
#
# # toggle window fullscreen zoom
# alt - f : yabai -m window --focus mouse && \
#           yabai -m window --toggle zoom-fullscreen
#
# # toggle window native fullscreen
# shift + alt - f : yabai -m window --toggle native-fullscreen
#
# # increase gap in focused space
# alt - g : yabai -m space --gap rel:10
#
# # decrease gap in focused space
# shift + alt - g : yabai -m space --gap rel:-10
#
# # create a new space and follow focus
# alt - n : yabai -m space --create && \
#                   index="$(yabai -m query --displays --display | jq '.spaces[-1]')" && \
#                   yabai -m space --focus "${index}"
#
# # create a new space, move window and follow focus
# shift + alt - n : yabai -m space --create && \
#                   index="$(yabai -m query --displays --display | jq '.spaces[-1]')" && \
#                   yabai -m window --space "${index}" && \
#                   yabai -m space --focus "${index}"
#
# # balance size of windows
# shift + alt - 0 : yabai -m space --balance
#
# # swap window
# shift + alt - h : yabai -m window --swap west
# shift + alt - n : yabai -m window --swap south
# shift + alt - e : yabai -m window --swap north
# shift + alt - i : yabai -m window --swap east
#
# # move window
# shift + cmd - h : yabai -m window --warp west
# shift + cmd - n : yabai -m window --warp south
# shift + cmd - e : yabai -m window --warp north
# shift + cmd - i : yabai -m window --warp east
#
# # send window to a space
# shift + alt - 1 : yabai -m window --space 1
# shift + alt - 2 : yabai -m window --space 2
# shift + alt - 3 : yabai -m window --space 3
# shift + alt - 4 : yabai -m window --space 4
# shift + alt - 5 : yabai -m window --space 5
# shift + alt - 6 : yabai -m window --space 6
# shift + alt - 7 : yabai -m window --space 7
# shift + alt - 8 : yabai -m window --space 8
# shift + alt - 9 : yabai -m window --space 9
# shift + alt - 0 : yabai -m window --space 10
#
# # change layout of desktop
# ctrl + alt - a : yabai -m space --layout bsp
# ctrl + alt - d : yabai -m space --layout float
#
# # increase window size
# ctrl + alt - h : yabai -m window --resize left:-40:0
# ctrl + alt - n : yabai -m window --resize bottom:0:40
# ctrl + alt - e : yabai -m window --resize top:0:-40
# ctrl + alt - i : yabai -m window --resize right:40:0
#
# # decrease window size
# ctrl + alt + cmd - h : yabai -m window --resize left:40:0
# ctrl + alt + cmd - n : yabai -m window --resize bottom:0:-40
# ctrl + alt + cmd - e : yabai -m window --resize top:0:40
# ctrl + alt + cmd - i : yabai -m window --resize right:-40:0
#
# # restart yabai
# ctrl + alt + cmd - r : launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"
#
