Trigger a shell script, URL call or send message when a specific is connected/disconnected
Hello,
now that issue #3682 has been implemented, it would be awesome to be able to trigger a script as well, one for connected and one for disconnected. That way we could easily switch some settings automatically (dock position, mouse scrolling direction etc.).
I know we could use 3rd party software for that, but since you already implemented the detection, it shouldn't be too hard to implement a trigger.
Thx for your awesome software btw, I'm an happy pro version user.
Yes, I plan something like this (ability to run scripts on various events).
Do you have an approximate ETA for it?
I generally don't have ETAs for features. :) But you can easily write a simple solution in Swift or use Hammerspoon or some other scripting tool that already watches the appropriate events until this is implemented.
Upvoting for this feature :)
Shortcut would also be nice, as it can run any other things like AppleScript, bash scripts or custom action.
Would love to disable all virtual displays when connecting main screen etc.
I generally don't have ETAs for features. :) But you can easily write a simple solution in Swift or use Hammerspoon or some other scripting tool that already watches the appropriate events until this is implemented.
Hey! Would you happen to know which event I should be listening to for when my display connects/disconnects?
Hammerspoon has I think a specific solution. In Swift you should use this and then evaluate the returned flags to determine the nature of the configuration change.
CGDisplayRegisterReconfigurationCallback({ displayID, flags, _ in myConfigFunction(callback: true, displayID: displayID, flags: flags) }, nil)
But I will probably add this feature soon now as it fits my current work on control integration nicely.
Hmm. I started implementing this but then came to the conclusion that to do this the right way I will need to create some general mechanisms for all other kinds of event driven integration scenarios so the feature-set can be expanded on the future. So I think I will do this in an other update instead as this will be a more complex project, don't want to do something hastily now that doesn't fit well. Sorry about that.