forge-ext / forge

Forge - Tiling and Window Manager for Gnome-Shell
GNU General Public License v3.0
838 stars 41 forks source link

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

Open tonymccallie opened 2 months ago

tonymccallie commented 2 months ago

(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.

jmmaranan commented 1 month ago

Hi there, yes this is possible

tonymccallie commented 1 month ago

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

jmmaranan commented 1 month ago

@tonymccallie -for implementation in the future. :)

tonymccallie commented 1 month ago

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 commented 1 month ago

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().