xabbu Posted June 29, 2017 Share Posted June 29, 2017 Hi - is it possible to get a workflow triggered by a change of displays? I would like to change the sound output device when I connect my external monitor automatically - I have seen the workflow 'alfred change sound output' (http://www.packal.org/workflow/alfred-change-sound-output) and it would be nice to make this switch to happen automatically when attaching/detaching the external monitor. Thanks, Axel Link to comment
deanishe Posted June 29, 2017 Share Posted June 29, 2017 Not with Alfred alone, no. Alfred responds only to user input/actions. You could use Keyboard Maestro to call a workflow. KM can also trigger actions based on other kinds of events, such as attached/detached hardware. I think it might also be possible using a Launch Agent, which is built into macOS. Link to comment
xabbu Posted June 29, 2017 Author Share Posted June 29, 2017 Thanks - I see. I noticed that I can get the event in hammerspoon (http://www.hammerspoon.org/) which I am using (via hs.screen.watcher) but had hoped it would be easier in Alfred. So I have to find a way, either to bridge from the hammerspoon event to alfred, or actually make the whole thing in hammerspoon (which should be possible through the hs.audiodevice module. I guess in the end it might be easier to do it here. Thanks in any case! Axel Link to comment
deanishe Posted June 29, 2017 Share Posted June 29, 2017 (edited) The workflow you referenced uses switchaudio-osx to do the actual work. You could probably call that quite easily from Hammerspoon instead. Edited June 29, 2017 by deanishe Link to comment
xabbu Posted June 29, 2017 Author Share Posted June 29, 2017 You are correct, of course - good idea! Thanks! Link to comment
xabbu Posted June 29, 2017 Author Share Posted June 29, 2017 In the end I am using the calls in Hammerspoon hs.audiodevice module directly - which seems to work nicely now. In case anybody would be interested, let me know. Thanks and regards, Axel Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now