jakehilborn / displayplacer

macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS.
MIT License
3.79k stars 136 forks source link

Can't modify screen arrangement on Ventura / M1 Pro #106

Open leecbaker opened 1 year ago

leecbaker commented 1 year ago

Here's my situation:

displayplacer list always reports the same configuration string, regardless of if they are swapped or not; it seems it can't tell if the the monitors are swapped:

Execute the command below to set your screens to the current arrangement:

displayplacer "id:C4F56F19-9C0E-45D5-B82A-30EFAF4DA42C res:2560x1440 hz:60 color_depth:7 scaling:on origin:(0,0) degree:0" "id:B914EACC-2AD5-470A-AFD5-0E1C163121CA res:2560x1440 hz:60 color_depth:7 scaling:on origin:(2560,0) degree:0"

Running the recommended command has no effect on displays at all; it always completes successfully (exit code 0 via echo $#)

This is my first time trying displayplacer, so I don't know if it would have worked on older OSes.

leecbaker commented 1 year ago

After some experimentation, I've got a solution that works consistently.

Specifying the "Persistent screen id"s seem to swap around, but the "Contextual screen id" seems to remain consistent across unplug/replug events.

This is the opposite of what I would expect from the documentation in the README:

Persistent screen ids always stay the same. Contextual screen ids change when switching GPUs or when switching ports. It's recommended to use persistent screen ids. In some rare cases, you may need to use contextual screen ids since the modes list changes when macOS switches GPUs.

Here is what I am currently using: displayplacer "id:3 res:2560x1440 scaling:on origin:(0,0)" "id:2 res:2560x1440 scaling:on origin:(2560,0)"

Given that this works, I'd say this is resolved for me.

TannerLarson commented 1 year ago

I've also been seeing the persistent screen IDs swapping every so often, and I am also using Ventura on an M1 Pro macbook. I'll try using the contextual screen ID for the next while to see if it works. I feel like a potential update to the README may be a good idea because I didn't know about this issue until I checked here.

PBartrina commented 1 year ago

Contextual screen ID is not working for me either

JoeGaebel commented 1 year ago

For those who the contextual ID isn't working, make sure you've got them in the right order. For me on an M1 Pro, the external monitor showed up first in the displayplacer output command, so the contextual id's needed to be 2 and then 1, like so:

displayplacer "id:2 res:3360x1890 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0" "id:1 res:1728x1117 hz:120 color_depth:8 scaling:on origin:(3360,773) degree:0"
jakehilborn commented 1 year ago

@leecbaker @TannerLarson @PBartrina @JoeGaebel displayplacer v1.4.0 supports addressing screens by serial id. If all of the screens in your setup have unique serial ids, this should fix the id switching issue.

Could you try out the new version and let me know if it works on your setup?