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

Add a possibility to "await" the moment when new window opens #226

Open
nikitabobko opened this issue May 15, 2024 · 0 comments
Open

Add a possibility to "await" the moment when new window opens #226

nikitabobko opened this issue May 15, 2024 · 0 comments
Labels
feature-proposal A well defined feature proposal triaged The issue makes sense to maintainers

Comments

@nikitabobko
Copy link
Owner

nikitabobko commented May 15, 2024

Problem

Suppose the user wants to open a new window and move to the particular workspace.

The naive solution won't work because open exits faster than the window appears:

open -n /Applications/kitty.app && aerospace move-node-to-workspace kitty

Proposed solutions

Solution 1. "callback" style command to run next commands once focus changes

aerospace run-when-focus-changes move-node-to-workspace kitty && open -n /Applications/kitty.app

Solution 2. "suspend" style command to await until the next window appears. (Harder to implement but prettier)

aerospace wait-for-new-window open -n /Applications/kitty.app && aerospace move-node-to-workspace kitty

Workaround

Use sleep. It's ugly and fragile

open -n /Applications/kitty.app && sleep 1 && aerospace move-node-to-workspace kitty
@nikitabobko nikitabobko changed the title Add a possibility to "await" the moment when the next window appears Add a possibility to "await" the moment when new window opens May 15, 2024
@nikitabobko nikitabobko added the feature-proposal A well defined feature proposal label Jun 13, 2024
@nikitabobko nikitabobko added the triaged The issue makes sense to maintainers label Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-proposal A well defined feature proposal triaged The issue makes sense to maintainers
Projects
None yet
Development

No branches or pull requests

1 participant