agzam / spacehammer

Hammerspoon config inspired by Spacemacs
MIT License
556 stars 70 forks source link

windows: Add resize-to-grid #159

Closed Grazfather closed 2 years ago

Grazfather commented 2 years ago

I use a bunch of mapping that move the active window to a preset grid (see here). In #155 I discovered the undo functionality, and would like to use it.

This PR simply adds a function that allows someone to resize a window to a specified grid, but pushes the dimensions onto the history stack so that undo works for it.

jaidetree commented 2 years ago

Wrote a similar feature for myself but cycles that grid dimension across each screen https://github.com/eccentric-j/dotfiles/blob/d2e525ebba256ead93d1a3fe4b28645caa7d25a3/spacehammer/config.fnl#L107-L129. Though not sure if I'd add history to that myself. Seems more deterministic to press the binding for the layout I want than trying to remember the layout state each window came from to use undo, but having that option doesn't hurt

Grazfather commented 2 years ago

I'd be happy to integrate that. My flow is basically to move a window to the screen I want and then to press the button for the specific layout. I don't really need undo but it's nice to have, and I don't need repeated presses to hop windows, but I don't think either would really be annoying in any way.

HyunggyuJang commented 2 years ago

For the tiling, I’m trying to adopt hhtwm within spacehammer framework, which can be seen here and corresponding bindings.

If you like, I’d like to open a pull request as draft for tiling feature.

Actually, #155 was to get back to the tiled state managed by hhtwm after maximization.

agzam commented 2 years ago

If you like, I’d like to open a pull request as draft for tiling feature.

That'd be awesome.