# 然后输入以下内容 其中 <user> 修改为当前 mac 的用户名 # input the line below into the file you are editing. # replace <yabai> with the path to the yabai binary (output of: which yabai). # replace <user> with your username (output of: whoami). # replace <hash> with the sha256 hash of the yabai binary (output of: shasum -a 256 $(which yabai)). # this hash must be updated manually after running brew upgrade. <user> ALL=(root) NOPASSWD: sha256:<hash> <yabai> --load-sa
# Uncomment to refresh ubersicht widget on workspace change # Make sure to replace WIDGET NAME for the name of the ubersicht widget #ubersicht_spaces_refresh_command="osascript -e 'tell application id \"tracesOf.Uebersicht\" to refresh widget id \"WIDGET NAME\"'"
# Navigation 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
#change focus between external displays (left and right) shift + ctrl - h: yabai -m display --focus west shift + ctrl - j: yabai -m display --focus south shift + ctrl - k: yabai -m display --focus north shift + ctrl - l: yabai -m display --focus east
# move window to display left and right shift + ctrl + alt - j : yabai -m window --display south; yabai -m display --focus south; shift + ctrl + alt - k : yabai -m window --display north; yabai -m display --focus north;
# Set insertion point for focused container #shift + ctrl + alt - h : yabai -m window --insert west #shift + ctrl + alt - j : yabai -m window --insert south #shift + ctrl + alt - k : yabai -m window --insert north #shift + ctrl + alt - l : yabai -m window --insert east
# Moving windows #shift + alt - h : yabai -m window --warp west #shift + alt - j : yabai -m window --warp south #shift + alt - k : yabai -m window --warp north #shift + alt - l : yabai -m window --warp east
# swap windows shift + alt - j : yabai -m window --swap south shift + alt - k : yabai -m window --swap north shift + alt - h : yabai -m window --swap west shift + alt - l : yabai -m window --swap east shift + alt - c : yabai -m space --create
# Move focus container to workspace shift + ctrl - m : yabai -m space --focus last shift + ctrl - p : yabai -m space --focus prev shift + ctrl - n : yabai -m space --focus next
shift + alt - m : yabai -m window --space last; yabai -m space --focus last shift + alt - p : yabai -m window --space prev; yabai -m space --focus prev shift + alt - n : yabai -m window --space next; yabai -m space --focus next shift + alt - 1 : yabai -m window --space 1; yabai -m space --focus 1 shift + alt - 2 : yabai -m window --space 2; yabai -m space --focus 2 shift + alt - 3 : yabai -m window --space 3; yabai -m space --focus 3 shift + alt - 4 : yabai -m window --space 4; yabai -m space --focus 4
# Resize windows ctrl + alt - h : yabai -m window --resize left:-50:0; \ yabai -m window --resize right:-50:0 ctrl + alt - j : yabai -m window --resize bottom:0:50; \ yabai -m window --resize top:0:50 ctrl + alt - k : yabai -m window --resize top:0:-50; \ yabai -m window --resize bottom:0:-50 ctrl + alt - l : yabai -m window --resize right:50:0; \ yabai -m window --resize left:50:0
# Equalize size of windows ctrl + alt - e : yabai -m space --balance
# Enable / Disable gaps in current workspace ctrl + alt - g : yabai -m space --toggle padding; yabai -m space --toggle gap
# Rotate windows clockwise and anticlockwise alt - r : yabai -m space --rotate 270 shift + alt - r : yabai -m space --rotate 90
# Rotate on X and Y Axis shift + alt - x : yabai -m space --mirror x-axis shift + alt - y : yabai -m space --mirror y-axis
# create a new file for writing - visudo uses the vim editor by default. # go read about this if you have no idea what is going on.
sudo visudo -f /private/etc/sudoers.d/yabai
# input the line below into the file you are editing. # replace <yabai> with the path to the yabai binary (output of: which yabai). # replace <user> with your username (output of: whoami). # replace <hash> with the sha256 hash of the yabai binary (output of: shasum -a 256 $(which yabai)). # this hash must be updated manually after running brew upgrade.