yabai: make a script to toggle tiling

This commit is contained in:
Nico 2025-10-28 20:37:40 +11:00
parent bfea190a66
commit a89b7cfe62
Signed by: nico
SSH key fingerprint: SHA256:XuacYOrGqRxC3jVFjfLROn1CSvLz85Dec6N7O9Gwu/0

View file

@ -0,0 +1,52 @@
#!/bin/sh
disableTiling () {
defaults write com.apple.dock orientation bottom
defaults write com.apple.dock autohide -bool FALSE
killall Finder Dock sketchybar borders
yabai -m config menubar_opacity 1.0
SPACES=("1" "2" "3" "4" "5" "6" "7" "8" "9")
for i in "${!SPACES[@]}"; do
yabai -m space $i --layout float
done
osascript -e 'tell application "System Events"
tell dock preferences
set properties to {autohide menu bar:false, autohide:false}
end tell
end tell'
}
enableTiling () {
defaults write com.apple.dock orientation right
defaults write com.apple.dock autohide -bool FALSE
killall Dock Finder
sketchybar &
sh ~/.cache/matugen-jankyborders.sh &
yabai -m config menubar_opacity 0.0
SPACES=("1" "2" "3" "4" "5" "6" "7" "8" "9")
for i in "${!SPACES[@]}"; do
yabai -m space $i --layout bsp
done
osascript -e '
tell application "System Events"
tell dock preferences
set properties to {autohide menu bar:true, autohide:true}
end tell
end tell
'
}
if [ "$1" = "on" ]; then
enableTiling
elif [ "$1" = "off" ]; then
disableTiling
else
echo "$0: [on|off]"
fi