Skip to main content
added 795 characters in body
Source Link
Hotschke
  • 218
  • 2
  • 9

Alternatives with larger issues

Untested alternative

Bspwm (linux)

An issue on github for the Linux tiling window manager bspwm can be found here with a mapping suggestion of the author of bspwm for bspwm (idea is the same as this answer).

Alternatives with larger issues

Untested alternative

Bspwm (linux)

An issue on github for the Linux tiling window manager bspwm can be found here with a mapping suggestion of the author of bspwm for bspwm (idea is the same as this answer).

added 2 characters in body
Source Link
Hotschke
  • 218
  • 2
  • 9
ctrl - left : index=`yabai -m query --spaces --space | jq '.index'` &&\
                        if (($index != 1 && $index != 6 )) then\
                            new=$((index-1)); \
                            other=$(((new+5new+4)%10%10+1));\
                            yabai -m space --focus "${other}"; yabai -m space --focus "${new}";\
                        fi
ctrl - right : index=`yabai -m query --spaces --space | jq '.index'` &&\
                        if (($index != 5 && $index != 10 )) then\
                            new=$((index+1)); \
                            other=$(((index+5index+4)%10+1));\
                            yabai -m space --focus "${other}"; yabai -m space --focus "${new}";\
                        fi
# ctrl+1-5:

ctrl - 1 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 6; yabai -m space --focus 1;\
                else \
                    yabai -m space --focus 1; yabai -m space --focus 6;\
                fi
ctrl - 2 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 7; yabai -m space --focus 2;\
                else \
                    yabai -m space --focus 2; yabai -m space --focus 7;\
                fi
ctrl - 3 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 8; yabai -m space --focus 3;\
                else \
                    yabai -m space --focus 3; yabai -m space --focus 8;\
                fi
ctrl - 4 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 9; yabai -m space --focus 4;\
                else \
                    yabai -m space --focus 4; yabai -m space --focus 9;\
                fi
ctrl - 5 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 10; yabai -m space --focus 5;\
                else \
                    yabai -m space --focus 5; yabai -m space --focus 10;\
                fi
ctrl - left : index=`yabai -m query --spaces --space | jq '.index'` &&\
                        if (($index != 1 && $index != 6 )) then\
                            new=$((index-1)); \
                            other=$(((new+5)%10));\
                            yabai -m space --focus "${other}"; yabai -m space --focus "${new}";\
                        fi
ctrl - right : index=`yabai -m query --spaces --space | jq '.index'` &&\
                        if (($index != 5 && $index != 10 )) then\
                            new=$((index+1)); \
                            other=$(((index+5)%10+1));\
                            yabai -m space --focus "${other}"; yabai -m space --focus "${new}";\
                        fi
# ctrl+1-5:

ctrl - 1 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 6; yabai -m space --focus 1;\
                else \
                    yabai -m space --focus 1; yabai -m space --focus 6;\
                fi
ctrl - 2 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 7; yabai -m space --focus 2;\
                else \
                    yabai -m space --focus 2; yabai -m space --focus 7;\
                fi
ctrl - 3 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 8; yabai -m space --focus 3;\
                else \
                    yabai -m space --focus 3; yabai -m space --focus 8;\
                fi
ctrl - 4 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 9; yabai -m space --focus 4;\
                else \
                    yabai -m space --focus 4; yabai -m space --focus 9;\
                fi
ctrl - 5 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 10; yabai -m space --focus 5;\
                else \
                    yabai -m space --focus 5; yabai -m space --focus 10;\
                fi
ctrl - left : index=`yabai -m query --spaces --space | jq '.index'` &&\
                        if (($index != 1 && $index != 6 )) then\
                            new=$((index-1)); \
                            other=$(((new+4)%10+1));\
                            yabai -m space --focus "${other}"; yabai -m space --focus "${new}";\
                        fi
ctrl - right : index=`yabai -m query --spaces --space | jq '.index'` &&\
                        if (($index != 5 && $index != 10 )) then\
                            new=$((index+1)); \
                            other=$(((index+4)%10+1));\
                            yabai -m space --focus "${other}"; yabai -m space --focus "${new}";\
                        fi
# ctrl+1-5:

ctrl - 1 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 6; yabai -m space --focus 1;\
                else \
                    yabai -m space --focus 1; yabai -m space --focus 6;\
                fi
ctrl - 2 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 7; yabai -m space --focus 2;\
                else \
                    yabai -m space --focus 2; yabai -m space --focus 7;\
                fi
ctrl - 3 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 8; yabai -m space --focus 3;\
                else \
                    yabai -m space --focus 3; yabai -m space --focus 8;\
                fi
ctrl - 4 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 9; yabai -m space --focus 4;\
                else \
                    yabai -m space --focus 4; yabai -m space --focus 9;\
                fi
ctrl - 5 : index=`yabai -m query --displays --display | jq '.index'` &&\
                if (($index == 1)) then\
                    yabai -m space --focus 10; yabai -m space --focus 5;\
                else \
                    yabai -m space --focus 5; yabai -m space --focus 10;\
                fi
added 1 character in body
Source Link
Hotschke
  • 218
  • 2
  • 9
#!/usr/bin/env sh
# file: ~/.config/yabai/maintain_paired_spaces.sh

# Keep two displays with spaces [1-5] and [6-12] in sync
#
# yabai signal 'space_changed'
# Passes two arguments $YABAI_SPACE_ID and $YABAI_RECENT_SPACE_ID

# Note $YABAI_SPACE_ID is not the same as the mission control index.
# Translate YABAI_SPACE_ID to mission control index as following
new=$(yabai -m query --spaces | jq ".[] | select(.id == $YABAI_SPACE_ID) | .index")

# modulo arithmetic
other=$(((new+4)%10+1))

# Check if already visible
visible=$(yabai -m query --spaces | jq ".[] | select(.visible == 1 and .index == $other)")
if [ -z "$visible" ]]; then
    yabai -m space --focus "${other}"
    display=$(yabai -m query --spaces --space $other | jq ".display")
fi
#!/usr/bin/env sh
# file: ~/.config/yabai/maintain_paired_spaces.sh

# Keep two displays with spaces [1-5] and [6-12] in sync
#
# yabai signal 'space_changed'
# Passes two arguments $YABAI_SPACE_ID and $YABAI_RECENT_SPACE_ID

# Note $YABAI_SPACE_ID is not the same as the mission control index.
# Translate YABAI_SPACE_ID to mission control index as following
new=$(yabai -m query --spaces | jq ".[] | select(.id == $YABAI_SPACE_ID) | .index")

# modulo arithmetic
other=$(((new+4)%10+1))

# Check if already visible
visible=$(yabai -m query --spaces | jq ".[] | select(.visible == 1 and .index == $other)")
if [ -z "$visible" ] then
    yabai -m space --focus "${other}"
    display=$(yabai -m query --spaces --space $other | jq ".display")
fi
#!/usr/bin/env sh
# file: ~/.config/yabai/maintain_paired_spaces.sh

# Keep two displays with spaces [1-5] and [6-12] in sync
#
# yabai signal 'space_changed'
# Passes two arguments $YABAI_SPACE_ID and $YABAI_RECENT_SPACE_ID

# Note $YABAI_SPACE_ID is not the same as the mission control index.
# Translate YABAI_SPACE_ID to mission control index as following
new=$(yabai -m query --spaces | jq ".[] | select(.id == $YABAI_SPACE_ID) | .index")

# modulo arithmetic
other=$(((new+4)%10+1))

# Check if already visible
visible=$(yabai -m query --spaces | jq ".[] | select(.visible == 1 and .index == $other)")
if [ -z "$visible" ]; then
    yabai -m space --focus "${other}"
    display=$(yabai -m query --spaces --space $other | jq ".display")
fi
added 3 characters in body
Source Link
Hotschke
  • 218
  • 2
  • 9
Loading
Add Yabai signal space_changed when using the dock
Source Link
Hotschke
  • 218
  • 2
  • 9
Loading
deleted 15 characters in body
Source Link
Hotschke
  • 218
  • 2
  • 9
Loading
added 107 characters in body
Source Link
Hotschke
  • 218
  • 2
  • 9
Loading
Source Link
Hotschke
  • 218
  • 2
  • 9
Loading