dotfiles/dot_skhdrc

150 lines
6.0 KiB
Plaintext
Executable File

####### Shortcut Hotkeys #############
# open terminal
alt - return : open -a iTerm
# restart Yabi, SpaceBar, and SKHD
alt + shift - r : \
launchctl kickstart -k "gui/${UID}/homebrew.mxcl.yabai"; \
skhd --reload
####### Window Management Hotkeys #############
# change focus
alt - h : yabai -m window --focus west
alt - j : yabai -m window --focus south
alt - k : yabai -m window --focus north
alt - l : yabai -m window --focus east
# (alt) change focus (using arrow keys)
alt - left : yabai -m window --focus west
alt - down : yabai -m window --focus south
alt - up : yabai -m window --focus north
alt - right : yabai -m window --focus east
# shift window in current workspace
alt + shift - h : yabai -m window --swap west || $(yabai -m window --display west; yabai -m display --focus west)
alt + shift - j : yabai -m window --swap south || $(yabai -m window --display south; yabai -m display --focus south)
alt + shift - k : yabai -m window --swap north || $(yabai -m window --display north; yabai -m display --focus north)
alt + shift - l : yabai -m window --swap east || $(yabai -m window --display east; yabai -m display --focus east)
# alternatively, use the arrow keys
alt + shift - left : yabai -m window --swap west || $(yabai -m window --display west; yabai -m display --focus west)
alt + shift - down : yabai -m window --swap south || $(yabai -m window --display south; yabai -m display --focus south)
alt + shift - up : yabai -m window --swap north || $(yabai -m window --display north; yabai -m display --focus north)
alt + shift - right : yabai -m window --swap east || $(yabai -m window --display east; yabai -m display --focus east)
# set insertion point in focused container
alt + ctrl - h : yabai -m window --insert west
alt + ctrl - j : yabai -m window --insert south
alt + ctrl - k : yabai -m window --insert north
alt + ctrl - l : yabai -m window --insert east
# (alt) set insertion point in focused container using arrows
alt + ctrl - left : yabai -m window --insert west
alt + ctrl - down : yabai -m window --insert south
alt + ctrl - up : yabai -m window --insert north
alt + ctrl - right : yabai -m window --insert east
# go back to previous workspace (kind of like back_and_forth in i3)
alt - b : yabai -m space --focus recent
# move focused window to previous workspace
alt + shift - b : yabai -m window --space recent; \
yabai -m space --focus recent
# navigate workspaces next / previous using arrow keys
# cmd - left : yabai -m space --focus prev
# cmd - right : yabai -m space --focus next
# move focused window to next/prev workspace
alt + shift - 1 : yabai -m window --space 1
alt + shift - 2 : yabai -m window --space 2
alt + shift - 3 : yabai -m window --space 3
alt + shift - 4 : yabai -m window --space 4
alt + shift - 5 : yabai -m window --space 5
alt + shift - 6 : yabai -m window --space 6
alt + shift - 7 : yabai -m window --space 7
alt + shift - 8 : yabai -m window --space 8
alt + shift - 9 : yabai -m window --space 9
alt + shift - 0 : yabai -m window --space 10
# # mirror tree y-axis
alt + shift - y : yabai -m space --mirror y-axis
# # mirror tree x-axis
alt + shift - x : yabai -m space --mirror x-axis
# balance size of windows
alt + shift - 0 : yabai -m space --balance
# increase window size
#alt + shift - a : yabai -m window --resize left:-20:0
#alt + shift - s : yabai -m window --resize bottom:0:20
#alt + shift - w : yabai -m window --resize top:0:-20
#alt + shift - d : yabai -m window --resize right:20:0
# decrease window size
#cmd + shift - a : yabai -m window --resize left:20:0
#cmd + shift - s : yabai -m window --resize bottom:0:-20
#cmd + shift - w : yabai -m window --resize top:0:20
#cmd + shift - d : yabai -m window --resize right:-20:0
# change layout of desktop
alt - e : yabai -m space --layout bsp
alt - s : yabai -m space --layout float
# float / unfloat window and center on screen
#alt - t : yabai -m window --toggle float;\
# yabai -m window --grid 4:4:1:1:2:2
# float / unfloat window and leave in its current location
alt + shift - space : yabai -m window --toggle float
#alt + ctrl - space : yabai -m window --toggle float
# make floating window fill screen
alt + cmd - up : yabai -m window --grid 1:1:0:0:1:1
# make floating window fill left-half of screen
alt + cmd - left : yabai -m window --grid 1:2:0:0:1:1
# make floating window fill right-half of screen
alt + cmd - right : yabai -m window --grid 1:2:1:0:1:1
# create desktop, move window and follow focus
alt + shift + cmd - n : yabai -m space --create;\
index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')"; \
yabai -m window --space "${index}";\
yabai -m space --focus "${index}"
# create desktop, move window and stay in current workspace
alt + shift - n : yabai -m space --create;\
index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')"; \
yabai -m window --space "${index}"
# create desktop and follow focus
# Note: script fails when workspace is empty due to Yabai not reporting the workspace (bug?)
# best to use the create + move window command instead of creating a blank window
alt - n : yabai -m space --create;\
index="$(yabai -m query --spaces --display | jq 'map(select(."native-fullscreen" == 0))[-1].index')"; \
yabai -m space --focus "${index}"
# destroy desktop
alt + cmd - w : yabai -m space --destroy
# close focused window
alt - w : yabai -m window --close
# toggle sticky
alt + ctrl - s : yabai -m window --toggle sticky
# enter fullscreen mode for the focused container
alt - f : yabai -m window --toggle zoom-fullscreen
# toggle window native fullscreen
alt + shift - f : yabai -m window --toggle native-fullscreen
# focus monitor
alt + ctrl - x : yabai -m display --focus recent
alt + ctrl - z : yabai -m display --focus prev
alt + ctrl - c : yabai -m display --focus next
alt + ctrl - 1 : yabai -m display --focus 1
alt + ctrl - 2 : yabai -m display --focus 2
alt + ctrl - 3 : yabai -m display --focus 3