From a89b7cfe62400e295b126313bd5a0596262b9633 Mon Sep 17 00:00:00 2001 From: Nico Date: Tue, 28 Oct 2025 20:37:40 +1100 Subject: [PATCH] yabai: make a script to toggle tiling --- stow/.config/yabai/toggle-tiling.sh | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 stow/.config/yabai/toggle-tiling.sh diff --git a/stow/.config/yabai/toggle-tiling.sh b/stow/.config/yabai/toggle-tiling.sh new file mode 100755 index 0000000..5ef3618 --- /dev/null +++ b/stow/.config/yabai/toggle-tiling.sh @@ -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