Created
September 4, 2025 12:11
-
-
Save MateuszKruk1303/0531ebdc54f694a81e3dcf7cd0775efb to your computer and use it in GitHub Desktop.
Yabai config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cmd - 9 : yabai --start-service | |
| cmd - 8 : yabai --stop-service | |
| # move between spaces with go-back functionality | |
| cmd - 1 : \ | |
| current=$(yabai -m query --spaces --space | jq -r '.index'); \ | |
| last=$(cat ~/.cache/yabai_last_space 2>/dev/null || echo "1"); \ | |
| if [ "$current" = "1" ] && [ "$last" != "1" ]; then \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus "$last"; \ | |
| else \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus 1; \ | |
| fi | |
| cmd - 2 : \ | |
| current=$(yabai -m query --spaces --space | jq -r '.index'); \ | |
| last=$(cat ~/.cache/yabai_last_space 2>/dev/null || echo "1"); \ | |
| if [ "$current" = "2" ] && [ "$last" != "2" ]; then \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus "$last"; \ | |
| else \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus 2; \ | |
| fi | |
| cmd - 3 : \ | |
| current=$(yabai -m query --spaces --space | jq -r '.index'); \ | |
| last=$(cat ~/.cache/yabai_last_space 2>/dev/null || echo "1"); \ | |
| if [ "$current" = "3" ] && [ "$last" != "3" ]; then \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus "$last"; \ | |
| else \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus 3; \ | |
| fi | |
| cmd - 4 : \ | |
| current=$(yabai -m query --spaces --space | jq -r '.index'); \ | |
| last=$(cat ~/.cache/yabai_last_space 2>/dev/null || echo "1"); \ | |
| if [ "$current" = "4" ] && [ "$last" != "4" ]; then \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus "$last"; \ | |
| else \ | |
| echo "$current" > ~/.cache/yabai_last_space; \ | |
| yabai -m space --focus 4; \ | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment