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 request: Command to close all workspaces except for the current #185

Open
mameen-omar opened this issue Mar 21, 2024 · 2 comments
Open

Comments

@mameen-omar
Copy link

Ask

To implement a command to close all workspaces except for the current.
When invoked, all workspaces except for the focused workspace should be closed and all windows on other workspaces should be moved to the current workspace.

@nikitabobko
Copy link
Owner

nikitabobko commented Mar 21, 2024

Q: What is your use case? What workflow do you find this command useful for?

(1) I agree that it should be possible to script this behavior. Right now, it's not possible to script it at all because of #173 . And even if #173 were implemented it would not be pleasant to script, because aerospace lacks some useful flags #186

Once #186 is implemented it will be possible to script the desired workflow this way:

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

(2) I respect the "batteries included approach". That's why I added close-all-windows-but-current and flatten-workspace-tree commands (btw the former should be renamed to smth like close-other-windows)

But I'm not convinced that the command to move all windows to the current workspace would be popular enough to include this battery.

How one would call this command? move-other-windows-to-workspace <workspace>? But it could be perceived as "moving other windows of the current workspace". A flag like --scope (workspace|all-workspaces) could be introduced. This way close-other-windows could be made possible to close windows on other workspaces. This actually sounds interesting, but I need more time to think about it. Other thoughts are welcome

@XA21X
Copy link

XA21X commented Aug 12, 2024

Q: What is your use case? What workflow do you find this command useful for?

My use case: I often don't want to use workspaces when I don't have any external monitors (normally have three). When I use the dock (or cmd-tab) to switch between apps, the workspace changes automatically, but I can't easily cycle between apps using the focus bindings, I have to remember which workspace I previously had the app/window. Thanks.

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

No branches or pull requests

3 participants