Hacker News new | ask | show | jobs
by dabeeeenster 934 days ago
https://www.hammerspoon.org/ is amazing. Not quite the same as Yabai but I cant live without it!
4 comments

You can configure Hammerspoon so a hot key combination puts a window in a defined section of the screen. For example, I use Ctrl+Alt+H to put the current window in the left half of the screen, Ctrl+Alt+L for the right half, Ctrl+Alt+Enter for full screen, etc. This makes arranging your windows very fast.

Full config: https://github.com/twpayne/dotfiles/blob/21d0edcebaeebf0d90e...

I use Magnet for that. But could probably put those key combinations into my hammerspoon config.
I have an alpha guide I wrote on scripting macOS with Hammerspoon if anyone's interested! There's probably some editing issues and I've been meaning to move it to the actual domain/clean it up to release, but it's got good info in it now:

https://learn-hammerspoon-0x8080.netlify.app/

I have a chapter on window management as part of the guide.

Phoenix [0] is another option in this space if you want to write JS/TS instead of Lua. I just commented about it here [1].

[0] https://github.com/kasper/phoenix

[1] https://news.ycombinator.com/item?id=38487077

Integrating hammerspoon as the keybinding manager for yabai is a perfect match. You can treat yabai as an api for window management, and script some pretty cool things, like sending the current window to a new space, and either keeping focus or not, swapping windows, all kinds of fun stuff.