Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Ability to evenly distribute windows with a keybind #382

Open
tonymccallie opened this issue May 1, 2024 · 5 comments
Open

[feature] Ability to evenly distribute windows with a keybind #382

tonymccallie opened this issue May 1, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@tonymccallie
Copy link

(1) Description

I was using Yabai on macOS as my first tiling windows. The transition to Forge has been fantastic and I love the way it's been implemented. My only request is the ability to bind a key to re-distribute the current windows evenly. Maybe that already exists and I just couldn't find it?

(2) Alternatives I've considered

No response

(3) Design / Screenshots / Mockups

Simplest example: I open two windows. I change one to be 2/3 width. I would love a key that would allow me to go back to even spacing.

@tonymccallie tonymccallie added the enhancement New feature or request label May 1, 2024
@tonymccallie tonymccallie changed the title Ability to evenly distribute windows [feature] Ability to evenly distribute windows May 1, 2024
@tonymccallie tonymccallie changed the title [feature] Ability to evenly distribute windows [feature] Ability to evenly distribute windows with a keybind May 1, 2024
@jmmaranan
Copy link
Collaborator

Hi there, yes this is possible

@tonymccallie
Copy link
Author

Wonderful! Is there already a command for this that I missed or is this a feature that would need to be implemented?

@jmmaranan
Copy link
Collaborator

@tonymccallie -for implementation in the future. :)

@tonymccallie
Copy link
Author

I'm a js developer and would love to help maybe? If you can point me where you might like to see this implemented, I can fork and see if I can help it along. (no promises I can do it well, but I'm willing to try)

@jmmaranan
Copy link
Collaborator

Sure.

You can start looking at how existing keybindings are loaded in extensions.js#enable():

this.keybindings = new Keybindings(this);

The actual kbd shortcuts are in schemas/*.xml - it uses the name of the keybinding to match the declaration on the js.
Then the function you need to call on the binding is tree.js#resetSiblingPercent(). Perhaps loop into the windows that Forge keeps track and add an entry on window.js#command().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants