Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

How to programmatically create and manage nodes? #609

Closed
3 tasks done
wbsmolen opened this issue Oct 22, 2024 · 1 comment
Closed
3 tasks done

How to programmatically create and manage nodes? #609

wbsmolen opened this issue Oct 22, 2024 · 1 comment
Labels
duplicate The issue is a duplicate

Comments

@wbsmolen
Copy link

wbsmolen commented Oct 22, 2024

I'm trying to use my config file to drive actions that Aerospace should run on-startup. I have 3 monitors and I want to move a workspace to each monitor. Then I want Workspace 1 (on an ultrawide) to have 2 nodes, 1 horizontally tiled and 1 vertically tiled.

Workspaces 2 and 3 have 1 node.

I want the config to use exec-and-forget to launch specific apps and place them in the workspaces. This is where I'm having my problem.

I'm trying to use after-startup-command:

after-startup-command = [
    "move-workspace-to-monitor --workspace 3 --wrap-around next",
    "move-workspace-to-monitor --workspace 2 --wrap-around prev",
    

    "workspace 1",
    "layout horizontal",
    "exec-and-forget open -a '<browser app>'",  
    "exec-and-forget open -a '<browser app>' --args --new-window", 
    "exec-and-forget open -a '<browser app>' --args --new-window",  
    "exec-and-forget open -a '<some app>'", 
    "split vertical",  
    "exec-and-forget open -a '<some app>'",  
    "exec-and-forget open -a '<some app>'",  


    "workspace 2",
    "layout vertical",
    "exec-and-forget open -a '<some app>'",
    "exec-and-forget open -a '<some app>'",


    "workspace 3",
    "layout horizontal",
    "exec-and-forget open -a '<some app>'"
]

But this isn't working. I looked at using exec-on-workspace-change but that would require Aerospace exposing an api for node management so a foreign bash script could leverage it. I don't believe that exists.

Checklist

$ aerospace --version
aerospace CLI client version: 0.15.2-Beta b6cf82771f245ab7349a93baf8709e171537ff58
AeroSpace.app server version: 0.15.2-Beta b6cf82771f245ab7349a93baf8709e171537ff58
@nikitabobko
Copy link
Owner

Opening windows/applications happens with the delay.

The use case that you describe is not about programmatically creating nodes, but about waiting till the windows appear and become accessible for manipulation

Duplicate of #226

@nikitabobko nikitabobko added the duplicate The issue is a duplicate label Oct 23, 2024
Repository owner locked and limited conversation to collaborators Oct 27, 2024
@nikitabobko nikitabobko converted this issue into discussion #624 Oct 27, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
duplicate The issue is a duplicate
Projects
None yet
Development

No branches or pull requests

2 participants