nikitabobko / AeroSpace

AeroSpace is an i3-like tiling window manager for macOS
https://nikitabobko.github.io/AeroSpace/guide
MIT License
5.3k stars 87 forks source link

Add more CLI flags #186

Open nikitabobko opened 5 months ago

nikitabobko commented 5 months ago

(1) Add --window-id option to all or almost all commands. This option would make the command behave like if <window-id> was focused

Motivation:

(2) Add --no-follow-focus to move and --follow-focus to move-node-to-workspace commands (btw, it's inconsistent that move follows focus by default, but move-node-to-workspace doesn't).

Motivation:

(3) Add --format window-id (or --window-id-only) to list-windows command.

Motivation: It's tedious and error-prone to write aerospace list-windows | awk '{print $1}'.

In the same way, --format monitor-id (or --monitor-id-only) can be added to list-monitors command


Motivation for all 3 flags:

(a) Move all windows to the current workspace #185:

focused=$(aerospace list-workspaces --focused)
aerospace list-windows --all --format window-id | xargs -n1 aerospace move-node-to-workspace $focused --follow-focus --window-id
nikitabobko commented 5 months ago

--follow-focus

It's more correct to name it --focus-follows-window

nikitabobko commented 4 months ago

I'm thinking out loud

--window-id is a bad name. Since the flag affects a lot of commands, it should have a more distinct, verbosish name; otherwise, it could "occupy" a flag name that commands might want to use for their own purposes. For example, the focus command now occupied its own --window-id flag which is not exactly the same as the proposed --window-id in this issue

Another observation is that an empty workspace might be the "subject" as well. The workspace flag needs to be named with a symmetrical name

Proposals:

Description proposal: Make the command acts as if the <subject-window-id> or <subject-workspace-name> was focused before the command execution

Other things that need to be thought about are:

nick-potts commented 3 months ago

How about --target-window and --target-workspace

nikitabobko commented 2 months ago

To make the flags even more useful move-node-to-workspace (and maybe move-node-to-monitor) should add support for focused argument:

USAGE: move-node-to-workspace [-h|--help] [--wrap-around] (next|prev)
   OR: move-node-to-workspace [-h|--help] focused
   OR: move-node-to-workspace [-h|--help] <workspace-name>

https://github.com/nikitabobko/AeroSpace/issues/299

MarcinDominiak commented 1 month ago

Thanks for pointing me here, do you have a time horizon in mind for those changes? I'm quite eagar to start using move-workspace-to-monitor --workspace <workspace> focused, and while this is outside my area of expertise I think I might be able to contribute it in a PR. Does that sound good to you @nikitabobko or do you want to flesh out the design/have an implementation planned already?

nikitabobko commented 1 month ago

and while this is outside my area of expertise I think I might be able to contribute it in a PR

I prefer to it implement it myself. The proper implementation requires non-trivial rewrites around CommandSubject and CommandMutableState.

Though nobody can stop you from forking and implementing your own ad-hoc solution until the proper implementation is ready.

do you have a time horizon in mind for those changes?

Everything in this project is ready when it's ready