diff --git a/config/skhd/skhdrc b/config/skhd/skhdrc new file mode 100644 index 0000000..2a4c9b7 --- /dev/null +++ b/config/skhd/skhdrc @@ -0,0 +1,30 @@ + +alt - j : yabai -m window --focus south +alt - k : yabai -m window --focus north +alt - h : yabai -m window --focus west +alt - l : yabai -m window --focus east + +# rotate layout clocwise +shift + alt - r : yabai -m space --rotate 270 + +# swap layout +shift + alt - s : yabai -m window --swap recent + +# maximize a window +shift + alt - m : yabai -m window --toggle zoom-fullscreen + +# float / unfloat window and center on screen +shift + alt - t : yabai -m window --toggle float --grid 4:4:1:1:2:2 + +# Move focus container to workspace +shift + alt - n : index=$(yabai -m query --spaces --display | jq 'first(.[] | select(.windows | length == 0) | .index)') && \ + yabai -m window --space ${index:-next} + +# increase window size +shift + alt - h : yabai -m window --resize left:-20:0; yabai -m window --resize right:20:0 +shift + alt - j : yabai -m window --resize bottom:0:20 +shift + alt - k : yabai -m window --resize top:0:-20 +shift + alt - l : yabai -m window --resize right:-20:0; yabai -m window --resize left:20:0 + +# open iterm +alt - return : open -na /Applications/iTerm.app diff --git a/config/yabai/yabairc b/config/yabai/yabairc new file mode 100755 index 0000000..a4b13a8 --- /dev/null +++ b/config/yabai/yabairc @@ -0,0 +1,42 @@ +# bsp or float (default: float) +yabai -m config layout bsp + +# on or off (default: off) +yabai -m config auto_balance on + +# New window spawns to the right if vertical split, or bottom if horizontal split +yabai -m config window_placement second_child + +# Set all padding and gaps to 20pt (default: 0) +yabai -m config top_padding 12 +yabai -m config bottom_padding 12 +yabai -m config left_padding 12 +yabai -m config right_padding 12 +yabai -m config window_gap 12 + +# set mouse follows focus mode (default: off) +yabai -m config mouse_follows_focus on + +yabai -m config focus_follows_mouse off + +yabai -m config mouse_drop_action swap + +# set mouse interaction modifier key (default: fn) +yabai -m config mouse_modifier alt + +# set modifier + left-click drag to move window (default: move) +yabai -m config mouse_action1 move + +# set modifier + right-click drag to resize window (default: resize) +yabai -m config mouse_action2 resize + +# float system preferences +yabai -m rule --add app="^System Settings$" manage=off +yabai -m rule --add app="^Calculator$" manage=off +yabai -m rule --add app="^Activity Monitor$" manage=off +yabai -m rule --add app="^Mail$" manage=off +yabai -m rule --add app="^PenTablet$" manage=off +yabai -m rule --add app="^Spotify$" manage=off +yabai -m rule --add app="^zoom.us$" manage=off +yabai -m rule --add app="^Calendar$" manage=off + diff --git a/home-manager/mac/home.nix b/home-manager/mac/home.nix index faf5103..321ddbd 100644 --- a/home-manager/mac/home.nix +++ b/home-manager/mac/home.nix @@ -104,13 +104,22 @@ # # }; # }; + xdg.configFile.yabai = { + source = ../../config/yabai; + recursive = true; + }; + + xdg.configFile.skhd = { + source = ../../config/skhd; + recursive = true; + }; + imports = [ - # ./../common-modules/fish.nix - ./../common-modules/direnv.nix - ./../common-modules/git.nix - ./../common-modules/tmux.nix - ./../common-modules/bat.nix + ./../../modules/direnv.nix + ./../../modules/git.nix + ./../../modules/tmux.nix + ./../../modules/bat.nix ./local-modules/neovim.nix ];