nikitabobko / AeroSpace

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

Question: can't bind cmd-hjkl and cmd-e ? #573

Open Timoyoungster opened 1 week ago

Timoyoungster commented 1 week ago

Hello, maybe I am missing something, but I'd like to set the focus/move commands to cmd-[shift-]hjkl and it doesn't work. Those key-combinations seem to just not do anything. I also have the same problem with cmd-e. Are those combinations not supported because of macos things or can I somehow make them work?

Checklist

aerospace CLI client version: 0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201
AeroSpace.app server version: 0.14.2-Beta 0cb8dbdfc5ee73b8cbc200f175f467ebead55201
ParisTheProgrammer commented 1 week ago

I don't think it's a question of "is it supported", you most likely will run into conflicts with other MacOS applications / system keybinds when using the cmd key. I assume this is the reason that alt/option was used by default.

I added cmd-shift-l = 'move right' to my config, and it works as expected.

CleanShot 2024-10-08 at 09 24 09

Out of curiosity, can you run aerospace config --config-path and post the output? This will at least prove that aerospace is reading your config and not the default config (this happened to me once because of an error in my config).

Timoyoungster commented 1 week ago

The shifted ones work (mostly; I think l and h don't for me) but the non shifted ones are the main problem for me. I have disabled all macos keybinds (that I could find) in System Settings -> Keyboard -> Keyboard Shortcuts but they still don't work. And I am sure it's reading my config correctly since I've played around a bit and managed to produce a few errors in reading the config along the way and most of my other keybinds that I changed work normally.

ParisTheProgrammer commented 1 week ago

@Timoyoungster it is something with your setup/config as I was able to add cmd-[hjkl] to my config and after reloading it works as you would expect (tested using focus). I can use all 8 keybinds below and each of them works as intended.

CleanShot 2024-10-08 at 11 55 34

If you're able/willing to post your config, might be able to troubleshoot further.

Timoyoungster commented 1 week ago

@ParisTheProgrammer very interesting. I have no idea what I am doing wrong. This would be my config aerospace.txt (had to upload it as txt due to github filetype restrictions)

ParisTheProgrammer commented 1 week ago

To test, I moved my aerospace config out of the .config directory and moved yours in its place. The only modification I made to your config before testing was the key-mapping.preset = dvorak on line 36 as I don't use that mapping.

This was quite an interesting experiment, as I would have bet money that using cmd-a to move to workspace 1 would have not worked but it works perfectly fine. I thought for sure that if an application uses cmd-a as a shortcut that it would override the aerospace shortcut but that's not what happened.

I also tested cmd-o to move to workspace 2 and cmd-u to move to workspace 4 and those worked. It's possible that the dvorak setting could be throwing a wrench in your setup?

Timoyoungster commented 1 week ago

I don't think so, since my initial testing was done with the setting set to querty and I only changed that to dvorak when I switched to the laptop keyboard and had to set the system keymap to dvorak. (with my external keyboard I leave the laptop on US mapping)

Really weird this whole ordeal.