asmvik / asmvik/yabai

Repeat zoom parent

Open
#1,483 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
C
Stars
29.6k
Forks
750
PR merge metrics
No merged PRs in 30d

Description

It would be neat to be able to repeat the zoom parent action, so that the window would zoom up the tree. Sometimes zoom-parent is not enough and fullscreen is too much for me.

Assuming window D has focus:

```
$ yabai -m window --zoom up
┌─────────────────┬─────────────────┬─────────────────┐
│ │ │ │
│ │ │ │
│ │ │ C │
│ │ │ │
│ A │ B ├─────────────────┤
│ │ │ │
│ │ │ │
│ │ │ D │
│ │ │ │
└─────────────────┴─────────────────┴─────────────────┘

$ yabai -m window --zoom up
┌─────────────────┬─────────────────┬─────────────────┐
│ │ │ │
│ │ │ │
│ │ │ │
│ A │ B │ D │
│ │ │ │
│ │ │ │
│ │ │ │
└─────────────────┴─────────────────┴─────────────────┘

$ yabai -m window --zoom up
┌─────────────────┬───────────────────────────────────┐
│ │ │
│ │ │
│ │ │
│ A │ D │
│ │ │
│ │ │
│ │ │
└─────────────────┴───────────────────────────────────┘

$ yabai -m window --zoom down
┌─────────────────┬─────────────────┬─────────────────┐
│ │ │ │
│ │ │ │
│ │ │ │
│ A │ B │ D │
│ │ │ │
│ │ │ │
│ │ │ │
└─────────────────┴─────────────────┴─────────────────┘
```

Right now I have a binding that makes the window floating and resize to a predetermined grid, but this makes things "reflow" and isn't as flexible for different layouts; so I end up with different mappings. This would let me only have to remember two mappings for zooming up and down.

Here's a suggested API:

```
yabai -m window --zoom up // zoom up one parent
yabai -m window --zoom down // zoom down again
yabai -m window --zoom reset // reset
yabai -m window --zoom abs:0 // reset
yabai -m window --zoom abs:2 // take up two parents
yabai -m window --zoom rel:2 // zoom up two parents
```

I guess this could be built right now with a bash script by querying windows etc, and I might do that when I find the time to do so, but I thought I shared this idea.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the window command's --zoom handling, especially the existing zoom-parent behavior described in the examples. Compare the requested up, down, reset, abs, and rel forms with current CLI behavior. Done means repeated zoom commands move through parent levels and restore prior layouts as specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, macos
Domain
cli, desktop, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.