FelixKratz / dotfiles

My personal macOS configuration
GNU General Public License v3.0
929 stars 92 forks source link

How to create new Space? #52

Closed h4ckd0tm3 closed 2 months ago

h4ckd0tm3 commented 3 months ago

Was already asked in #50 but closed without clarifying how to actually create a new space. Might just me being stupid but I really can't find it ^^'.

Thank you in advance!

starboi-63 commented 3 months ago

Not sure if this helps, but I use skhd with the following keybinds for spaces:

## Navigation (lalt - ...)
# Create a new space: lalt + n
lalt - n : yabai -m space --create

# Move to previous/next space: lalt - {i, o}
lalt - i : yabai -m space --focus prev
lalt - o : yabai -m space --focus next

# Delete the current space: lalt + w
lalt - w : yabai -m space --destroy

# Space Navigation (four spaces per display): lalt - {1, 2, 3, 4}
lalt - 1 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[1] ]] && yabai -m space --focus $SPACES[1]
lalt - 2 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[2] ]] && yabai -m space --focus $SPACES[2]
lalt - 3 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[3] ]] && yabai -m space --focus $SPACES[3]
lalt - 4 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[4] ]] && yabai -m space --focus $SPACES[4]

So, lalt + n in this case would create a new space. But really, you should be able to click on the right arrow between the spaces and front_app:

image
h4ckd0tm3 commented 3 months ago

Not sure if this helps, but I use skhd with the following keybinds for spaces:

## Navigation (lalt - ...)
# Create a new space: lalt + n
lalt - n : yabai -m space --create

# Move to previous/next space: lalt - {i, o}
lalt - i : yabai -m space --focus prev
lalt - o : yabai -m space --focus next

# Delete the current space: lalt + w
lalt - w : yabai -m space --destroy

# Space Navigation (four spaces per display): lalt - {1, 2, 3, 4}
lalt - 1 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[1] ]] && yabai -m space --focus $SPACES[1]
lalt - 2 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[2] ]] && yabai -m space --focus $SPACES[2]
lalt - 3 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[3] ]] && yabai -m space --focus $SPACES[3]
lalt - 4 : SPACES=($(yabai -m query --displays --display | jq '.spaces[]')) && [[ -n $SPACES[4] ]] && yabai -m space --focus $SPACES[4]

So, lalt + n in this case would create a new space. But really, you should be able to click on the right arrow between the spaces and front_app:

image

Thanks for sharing! I am currently using the new Lua based config, which is missing the arrow and I could not find a replacement for that yet. Will probably use ur approach with the key bindings!

Thanks!

starboi-63 commented 3 months ago

Of course!