-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add more CLI flags #186
Comments
It's more correct to name it |
I'm thinking out loud
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 Other things that need to be thought about are:
|
How about |
To make the flags even more useful
|
Previously, Workspace.mostRecentWindow was the source of focus. This commit introduces a separate 'focus: LiveFocus' property that is responsible to track the focused window/emptyWorkspace. Soon will become possible to do things like 'move-node-to-workspace --window-id 42 focused' (#186) Since I don't want this command changing the focus on the workspace, we need to decouple focus state management from mostRecentWindow This commit breaks the following tests: - Test Case '-[AppBundleTests.FocusCommandTest testFocusWrapping]' failed (0.000 seconds). - Test Case '-[AppBundleTests.FlattenWorkspaceTreeCommandTest testSimple]' failed (0.004 seconds). I will fix the tests in the next commits
Thanks for pointing me here, do you have a time horizon in mind for those changes? I'm quite eagar to start using |
I prefer to it implement it myself. The proper implementation requires non-trivial rewrites around Though nobody can stop you from forking and implementing your own ad-hoc solution until the proper implementation is ready.
Everything in this project is ready when it's ready |
Previously, Workspace.mostRecentWindow was the source of focus. This commit introduces a separate 'focus: LiveFocus' property that is responsible to track the focused window/emptyWorkspace. Soon will become possible to do things like 'move-node-to-workspace --window-id 42 focused' (nikitabobko#186) Since I don't want this command changing the focus on the workspace, we need to decouple focus state management from mostRecentWindow This commit breaks the following tests: - Test Case '-[AppBundleTests.FocusCommandTest testFocusWrapping]' failed (0.000 seconds). - Test Case '-[AppBundleTests.FlattenWorkspaceTreeCommandTest testSimple]' failed (0.004 seconds). I will fix the tests in the next commits
… CmdResult This commit lays out the foundation for the following issues - #186 - #278 - #20 Also the commit changes how focused window is tracked throught the chain of executed commands. - CommandMutableState was a mutable state that tracked the focused window, and the track had to be updated throught the chain of executed commands (for example, take a look at the `focus` command) - CmdEnv is simplier. It just forces a particular window to be percieved as "focused". CmdEnv approach makes things easier to understand and describe in the docs (which I'm going to do later, CmdEnv will be exposed as AEROSPACE_FOCUSED_WORKSPACE and AEROSPACE_FOCUSED_WINDOW_ID environment variables) Unlike CommandMutableState, CmdEnv approach disallows to change focused window in on-window-detected, on-focus-changed, and other callbacks. Which I think is not an issue at all. It maybe even considered a safety mechanism. If a user uses `close` in one of the mentioned callbacks, previously, a random window could become focused and it would receive all the following commands. Now, all the commands that go after `close` will fail with "Invalid <window-id> \(windowId) specified in AEROSPACE_FOCUSED_WINDOW_ID env variable" - This commit is not a breaking change for on-window-detected thanks to limitations in #20 - But this commit is technically a breaking change for other mentioned callbacks, since no limitations were impoosed on those callbacks. But I don't believe that anyone in sane mind relied on it. And the docs are explicit that changing focus in those callbacks is a bad idea: > Changing the focus within these callbacks is a bad idea anyway, and the way it’s handled will probably change in future versions. Currently, the "force focused state" in CmdEnv is immutable, and I hope it will stay so. But hypothetically, it can be mutable in future versions if we decide that the embedded language #278 should allow chaning environment variables.
_fixes #338 #186 The command is a replacement for planned `move-workspace-to-monitor --workspace <workspace> focused`. The problem with `move-workspace-to-monitor` is that, unlike `move-workspace-to-monitor next|prev`, it changes the focused workspace. That's why I think it should be a separate command with its own semantic
_fixes #338 #186 The command is a replacement for planned `move-workspace-to-monitor --workspace <workspace> focused`. The problem with `move-workspace-to-monitor` is that, unlike `move-workspace-to-monitor next|prev`, it changes the focused workspace. That's why I think it should be a separate command with its own semantic
Released in 0.15.0-Beta
I decided to extract it to a separate |
(1) Add
--window-id
option to all or almost all commands. This option would make the command behave like if<window-id>
was focusedMotivation:
--window-id
is already presented. That's howon-window-detected.run
is implemented. We could make it more transparent by saying in the docs that--window-id
is applied by default to all of theon-window-detected.run
commands. Lift limitations inon-window-detected.run
#20focus
command then we force focus the current window. This way focusing the window by id becomesaerospace --window-id <ID> focus
(2) Add
--no-follow-focus
tomove
and--follow-focus
tomove-node-to-workspace
commands (btw, it's inconsistent thatmove
follows focus by default, butmove-node-to-workspace
doesn't).Motivation:
aerospace move-node-to-workspace <workspace> && aerospace workspace <workspace>
, but it gets more problematic whenmove-node-to-workspace
is invoked byxargs
. "Follow focus" is quite a common use case, it would be nice to have a flag for it.on-window-detected.run
#20 by saying that--follow-focus
is applied by default tomove-node-to-workspace
(3) Add
--format window-id
(or--window-id-only
) tolist-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 tolist-monitors
commandMotivation for all 3 flags:
(a) Move all windows to the current workspace #185:
The text was updated successfully, but these errors were encountered: