yabai
- MacOSの
i3-gapps
に近いものがないか探したら見つかった
Install
$ brew install koekeishiya/formulae/yabai
$ brew install koekeishiya/formulae/skhd
どんどん仕様が変わっているので、公式GitHub Wikiを参考にする
start as services and install script
$ brew services start yabai
$ brew services start skhd
System Integrity Protectionを無効化した上で、scriptを走らせるのに以下の設定が必要
$ sudo yabai --install-sa
yabaiがupdateされてscriptが更新されたら、scriptをuninstallした上でもう一度installする
$ sudo yabai --uninstall-sa
$ sudo yabai --install-sa
Disabling System Integrity Protection
- 公式参照
- M1 Macだと仕様が異なり、現在、完全に対応できていない。また、
csrutil
でいくつかセキュリティレベルを下げるとiPad用のAppが動かなくなる現象に遭遇した
skhdについて
- システムにコマンドを送信するためのサービスのようで、yabai以外にもkeyのリマップ等に使える可能性がある
設定の再読み込み
$ skhd --reload
yabaiの設定変更時、バグったとき等の再起動
$ brew services restart yabai
.yabairc
#!/usr/bin/env sh
# global settings
yabai -m config mouse_follows_focus on
yabai -m config focus_follows_mouse autoraise
yabai -m config window_placement second_child
yabai -m config window_topmost on
yabai -m config window_shadow off
yabai -m config window_opacity on
yabai -m config window_opacity_duration 0.0
yabai -m config active_window_opacity 1.0
yabai -m config normal_window_opacity 0.6
yabai -m config window_border on
yabai -m config window_border_width 6
yabai -m config active_window_border_color 0xff775759
yabai -m config normal_window_border_color 0xff555555
yabai -m config insert_feedback_color 0xaad75f5f
yabai -m config split_ratio 0.50
yabai -m config auto_balance on
yabai -m config mouse_modifier fn
yabai -m config mouse_action1 move
yabai -m config mouse_action2 resize
# general space settings
yabai -m config layout bsp
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
.skhdrc
## focus window
### alt - x : yabai -m window --focus recent
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
### alt - z : yabai -m window --focus prev
### alt - c : yabai -m window --focus next
## swap window
### shift + alt - x : yabai -m window --swap recent
shift + alt - left : yabai -m window --swap west
shift + alt - down : yabai -m window --swap south
shift + alt - up : yabai -m window --swap north
shift + alt - right : yabai -m window --swap east
## rotate tree
alt - r : yabai -m space --rotate 90
## toggle window split type
alt - e : yabai -m window --toggle split
## increase window size
alt - h : yabai -m window --resize left:-10:0
alt - j : yabai -m window --resize bottom:0:10
alt - k : yabai -m window --resize top:0:-10
alt - l : yabai -m window --resize right:10:0
## decrease window size
shift + alt - l : yabai -m window --resize left:10:0
shift + alt - k : yabai -m window --resize bottom:0:-10
shift + alt - j : yabai -m window --resize top:0:10
shift + alt - h : yabai -m window --resize right:-10:0
## move window
shift + cmd - h : yabai -m window --warp west
shift + cmd - j : yabai -m window --warp south
shift + cmd - k : yabai -m window --warp north
shift + cmd - l : yabai -m window --warp east
## move window
shift + ctrl - a : yabai -m window --move rel:-10:0
shift + ctrl - s : yabai -m window --move rel:0:10
shift + ctrl - w : yabai -m window --move rel:0:-10
shift + ctrl - d : yabai -m window --move rel:10:0
## mirror tree y-axis
alt - y : yabai -m space --mirror y-axis
## mirror tree x-axis
alt - x : yabai -m space --mirror x-axis
## toggle desktop offset
alt - a : yabai -m space --toggle padding && yabai -m space --toggle gap
## toggle window fullscreen zoom
alt - f : yabai -m window --toggle zoom-fullscreen
## toggle window native fullscreen
shift + alt - f : yabai -m window --toggle native-fullscreen
## float / unfloat window and restore position
## alt - t : yabai -m window --toggle float && /tmp/yabai-restore/$(yabai -m query --windows --wind
ow | jq -re '.id').restore 2>/dev/null || true
alt - t : yabai -m window --toggle float && yabai -m window --grid 4:4:1:1:2:2