spacehammer icon indicating copy to clipboard operation
spacehammer copied to clipboard

feature request: layouts

Open agzam opened this issue 6 years ago • 3 comments

Would be nice to have window layouts or workspaces that can be persisted and restored at will.

agzam avatar Jun 30 '19 23:06 agzam

I think this ties into what was discussed in #119 for the tiling window features.

Found https://www.hammerspoon.org/docs/hs.window.layout.html today which might be useful for that or implementing our version with that API. Didn't look at it too deeply yet.

The key question that comes to mind though is how should we store it? I'm leaning towards a JSON file in ~/.spacehammer/config/layouts.json but open to discussion\alternatives.

jaidetree avatar Sep 12 '21 23:09 jaidetree

I wrote this issue when there was no prospect of tiling WM anywhere on the horizon. I think the scope of this ticket would change significantly. Maybe let's put a pin in it for now?

agzam avatar Sep 15 '21 23:09 agzam

That's fine. I do have a working implementation I've been using for a year or so https://github.com/eccentric-j/dotfiles/blob/f309465a098bd50bec9ab559626b7fa7ce36948d/spacehammer/layouts.fnl. I wasn't sure how to best incorporate it because these layouts are clearly defined against my grid settings and personal preference.

If people are interested in this, I could create a simple higher-order-function for taking a grid string to apply a layout. Also of note, applying a layout once applies it to the current screen, applying it again will apply it to the next screen and any further repeats will cycle through screens until another layout is applied or another window is targeted.

jaidetree avatar Sep 16 '21 00:09 jaidetree