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

on-monitor-detected callback #824

Open
derrik-fleming opened this issue Dec 6, 2024 · 4 comments
Open

on-monitor-detected callback #824

derrik-fleming opened this issue Dec 6, 2024 · 4 comments
Labels
feature-proposal A well defined feature proposal

Comments

@derrik-fleming
Copy link

derrik-fleming commented Dec 6, 2024

Not sure how feasible this is as a feature, but for those who want to execute a callback when a secondary display is detected a callback or condition for the existing callbacks could be useful. These are just two things that came to mind immediately when trying to solve this. I'm open to suggestions if this is a solved problem using the provided configuration, or otherwise. I think it'd be easily achievable using the CLI commands in a shell script but I'd appreciate a way for handling it within the config if possible.

I like the idea of binding applications to workspaces with mnemonic names, my browser lives on workspace b, terminal emulator on t, etc. I set up the window detection callbacks for the apps that I care about to move them to the desired workspaces. This works great when I don't have my external monitor connected. However, my main external monitor is a ultra-wide and more than capable of having 2 or 3 applications side-by-side.

I want to bind applications to workspaces and I want separate bindings depending on whether or not specific external monitor(s) is connected. I also want to be able to execute commands when I connect my external monitor.

@derrik-fleming derrik-fleming added the feature-proposal A well defined feature proposal label Dec 6, 2024
@fcaraujo
Copy link

++

I was about to suggest something similar and found this proposal. : )

I'm trying to run a command when the list of monitors changes (connecting/disconnection my 2nd monitor); in my case I want to trigger an event on my sketchybar as an example.

We could call it exec-on-monitor-change to follow the patter of the existing exec-on-workspace-change.

@nikitabobko I'm happy to jump on and learn how to contribute to the project if you or other maintainers are keen on having this in place, I'd just need some directions.

@nikitabobko nikitabobko changed the title On monitor detected or if.monitor-detected on-monitor-detected callback Dec 17, 2024
@nikitabobko
Copy link
Owner

The issue doesn't mention use cases

I'm trying to run a command when the list of monitors changes (connecting/disconnection my 2nd monitor); in my case I want to trigger an event on my sketchybar as an example.

Why do you add AeroSpace in the mix? Shouldn't it be handled purely by sketchybar?

We could call it exec-on-monitor-change to follow the patter of the existing exec-on-workspace-change.

I don't like exec-on-workspace-change callback, it's inconsistent with everything else. I hope that eventually exec-on-workspace-change will be replaced with: on-workspace-change = 'exec-and-forget ...'. But design questions of #278 and #351 has to be figured first

@derrik-fleming
Copy link
Author

The issue doesn't mention use cases

@nikitabobko I've edited the original comment to include more details about my specific desires and use case.

@stschaef
Copy link

Building off of the original feature request

I'm looking for functionality that would allow aerospace to assign workspaces to take display precedence when an external monitor is connected. For instance, I'd like display my b, m, and c on each display by default when I connect to my external monitors at work, but aerospace will display workspaces 1, 2, and 3. A display callback could let me focus these upon connection

I also have a different monitor at home, and I'd like to configure some default tiling to trigger when that display is connected.

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
Projects
None yet
Development

No branches or pull requests

4 participants