TomBenz Posted June 7, 2023 Share Posted June 7, 2023 Workflow request I use multiple monitors at home and work whose layouts are different. Need to go to Display settings and arrange it. Is it possible to automate this with the help of Alfred workflow? I copy some relevant links https://apple.stackexchange.com/questions/249447/change-display-arrangement-in-os-x-macos-programmatically https://github.com/jakehilborn/displayplacer thanks for your assistance in advance Link to comment
TomBenz Posted June 9, 2023 Author Share Posted June 9, 2023 On 6/7/2023 at 7:55 PM, TomBenz said: Workflow request I use multiple monitors at home and work whose layouts are different. Need to go to Display settings and arrange it. Is it possible to automate this with the help of Alfred workflow? I copy some relevant links https://apple.stackexchange.com/questions/249447/change-display-arrangement-in-os-x-macos-programmatically https://github.com/jakehilborn/displayplacer thanks for your assistance in advance @vitor is there a workflow for this? request for your suggestions or if it is worthwhile to try and solve this. I can work on writing AppleScript for it accordingly Link to comment
vitor Posted June 9, 2023 Share Posted June 9, 2023 2 hours ago, TomBenz said: is there a workflow for this? I’m not aware of any. 2 hours ago, TomBenz said: or if it is worthwhile to try and solve this. It looks to be a niche need, though I definitely see the point. The challenge might be in making it generic enough since this will be quite specific to anyone’s setup from the number of locations to screens, to positions. Making it work in pure AppleScript is unlikely to be feasible. I’d recommend building it for yourself then seeing how you feel about it. The setup to get it exactly how you like might take you longer than the code itself. TomBenz 1 Link to comment
TomBenz Posted June 12, 2023 Author Share Posted June 12, 2023 On 6/9/2023 at 9:45 PM, vitor said: I’m not aware of any. It looks to be a niche need, though I definitely see the point. The challenge might be in making it generic enough since this will be quite specific to anyone’s setup from the number of locations to screens, to positions. Making it work in pure AppleScript is unlikely to be feasible. I’d recommend building it for yourself then seeing how you feel about it. The setup to get it exactly how you like might take you longer than the code itself. @vitor I have been able to get display setup using displayplacer list and run it via terminal attached to keyword. It is not generalized and good enough for my requirement. I will put 3-4 configuration used and convert to list filter in future. Steps 1. Set the display manually to preferred position, resolution etc. 2. Used this to get the configuration set commandOutput to do shell script "/opt/homebrew/bin/displayplacer list" --set commandOutput to do shell script "displayplacer list" set searchString to "Execute the command below to set your screens to the current arrangement:" set startIndex to offset of searchString in commandOutput set extractedInfo to text (startIndex + (length of searchString) + 2) through -1 of commandOutput display dialog extractedInfo 3. Save this in a workflow attaching keyword to terminal command with output from step 2. This can possibly be used for a more generic workflow. Link to comment
vitor Posted June 12, 2023 Share Posted June 12, 2023 An alternative to the keyword is a List Filter which lists your setups so you can choose. TomBenz 1 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