Jump to content

Save current display layout and apply from saved list


Recommended Posts

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
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
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.

Link to comment
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...