nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
6.21k stars 101 forks source link

Multiple monitor navigation doesn't appear to work #548

Open alexgorbatchev opened 2 days ago

alexgorbatchev commented 2 days ago

Using v0.14.2 I found that I'm unable to navigate between monitors. I have 3 monitors in this configuration

-----  -----
| 2 |  |   |
-----  | 3 |
-----  |   |
| 1 |  |   |
-----  -----

I can only jump from 1 to 3 and back using focus-monitor left and focus-monitor right. I can still get the job done by focusing monitors by using workspace [int] command.

My config

after-login-command = []
after-startup-command = []
start-at-login = true
enable-normalization-flatten-containers = true
enable-normalization-opposite-orientation-for-nested-containers = true
accordion-padding = 30
default-root-container-layout = 'tiles'
default-root-container-orientation = 'auto'
key-mapping.preset = 'qwerty'

[workspace-to-monitor-force-assignment]
1 = ['^Gigabyte.*', 'built-in']
2 = ['^Gigabyte.*', 'built-in']
3 = ['^LG.*', 'Z1-7', 'secondary']
4 = ['^LG.*', 'Z1-7', 'secondary']
5 = ['^DELL.*']
6 = ['^DELL.*']

[gaps]
inner.horizontal = 10
inner.vertical =   10
outer.left =       5
outer.bottom =     5
outer.top =        5
outer.right =      5

[exec]                   # Again, you don't need to copy all config sections to your config.
inherit-env-vars = true  # If you don't touch "exec" section,
[exec.env-vars]          # it will fallback to "default-config.toml"
PATH = '/opt/homebrew/bin:/opt/homebrew/sbin:${PATH}'

[mode.main.binding]
alt-period = 'layout tiles horizontal vertical'
alt-comma = 'layout accordion horizontal vertical'

# See: https://nikitabobko.github.io/AeroSpace/commands#focus
alt-h = 'focus left'
alt-j = 'focus down'
alt-k = 'focus up'
alt-l = 'focus right'

alt-ctrl-h = 'focus-monitor left'
alt-ctrl-j = 'focus-monitor down'
alt-ctrl-k = 'focus-monitor up'
alt-ctrl-l = 'focus-monitor right'

alt-shift-ctrl-h = 'move-node-to-monitor left'
alt-shift-ctrl-j = 'move-node-to-monitor down'
alt-shift-ctrl-k = 'move-node-to-monitor up'
alt-shift-ctrl-l = 'move-node-to-monitor right'

# See: https://nikitabobko.github.io/AeroSpace/commands#move
alt-shift-h = 'move left'
alt-shift-j = 'move down'
alt-shift-k = 'move up'
alt-shift-l = 'move right'

# See: https://nikitabobko.github.io/AeroSpace/commands#resize
alt-shift-minus = 'resize smart -100'
alt-shift-equal = 'resize smart +100'

# See: https://nikitabobko.github.io/AeroSpace/commands#workspace
alt-1 = 'workspace 1'
alt-2 = 'workspace 2'
alt-3 = 'workspace 3'
alt-4 = 'workspace 4'
alt-5 = 'workspace 5'
alt-6 = 'workspace 6'

alt-shift-1 = 'move-node-to-workspace 1'
alt-shift-2 = 'move-node-to-workspace 2'
alt-shift-3 = 'move-node-to-workspace 3'
alt-shift-4 = 'move-node-to-workspace 4'
alt-shift-5 = 'move-node-to-workspace 5'
alt-shift-6 = 'move-node-to-workspace 6'

# See: https://nikitabobko.github.io/AeroSpace/commands#workspace-back-and-forth
alt-tab = 'workspace-back-and-forth'
# See: https://nikitabobko.github.io/AeroSpace/commands#move-workspace-to-monitor
alt-shift-tab = 'move-workspace-to-monitor --wrap-around next'

# See: https://nikitabobko.github.io/AeroSpace/commands#mode
alt-shift-semicolon = 'mode service'

# 'service' binding mode declaration.
# See: https://nikitabobko.github.io/AeroSpace/guide#binding-modes
[mode.service.binding]
esc = ['reload-config', 'mode main']
r = ['flatten-workspace-tree', 'mode main'] # reset layout
f = ['layout floating tiling', 'mode main'] # Toggle between floating and tiling layout
backspace = ['close-all-windows-but-current', 'mode main']

alt-shift-h = ['join-with left', 'mode main']
alt-shift-j = ['join-with down', 'mode main']
alt-shift-k = ['join-with up', 'mode main']
alt-shift-l = ['join-with right', 'mode main']
ParisTheProgrammer commented 1 day ago

You may need to use focus-monitor-up and/or focus-monitor-down instead of just left and right for your monitor config.

It's possible that adding --wrap-around might make left and right work, i don't have your monitor configuration to test that though.

9. focus-monitor aerospace focus-monitor [-h|--help] [--wrap-around] (left|down|up|right) aerospace focus-monitor [-h|--help] [--wrap-around] (next|prev) aerospace focus-monitor [-h|--help] ... Focus monitor by relative direction, by order, or by pattern

OPTIONS

-h, --help Print help

--wrap-around Make it possible to wrap around focus

ARGUMENTS

(left|down|up|right) Focus monitor in direction relative to the focused monitor

(next|prev) Focus next|prev monitor in order they appear in tray icon

Find the first monitor pattern in the list that doesn’t describe the current monitor and focus it. Monitor pattern is the same as in workspace-to-monitor-force-assignment config option
alexgorbatchev commented 1 day ago

Correct. I find that I'm not able to navigate between monitors reliably with focus-monitor *. Right this second focus-monitor-up jumps me from 1 to 3. When 3 has focus, I can only jump to 1 via focus-monitor left. I can't get to 2 via any focus-monitor * at all. However, when manually focusing 2, i'm able to get to 3 using fm right and to 1 using fm down (so that works as expected).

I'm not able to use focus-monitor-* style commands, I get the following error:

image
ParisTheProgrammer commented 1 day ago

focus-monitor-left is not a valid command, it would need to be focus-monitor left (no dash). That would explain your error message.

For troubleshooting purposes, are you able to post a picture of the "Arrange Displays" page inside of the mac display settings?

CleanShot 2024-10-01 at 14 45 43

And also the output of aerospace list-monitors ? 1 | DELL S2721DGF (1) 2 | DELL S2721DGF (2)

alexgorbatchev commented 1 day ago

Sure! Here's the screenshot. This made me realize that i was an idiot and completely forgot about the laptop screen, doh! i barely ever use the actual laptop screen and completely forgot it was even there. This maybe making something weird.

image
$ aerospace list-monitors
1 | LG HDR 4K
2 | Gigabyte M32U
3 | DELL U3415W
4 | Built-in Retina Display
ParisTheProgrammer commented 1 day ago

Aha ok, yep that macbook lid being open definitely throws a wrench in this issue. If you try your config without the macbook lid being open, does anything change?