-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display UUIDs sometimes not match physical screens #77
Comments
I join the problem. If you try to manually change the monitor settings, then through the script it turns out to return the settings. If the laptop wakes up from sleep mode, then the script does not work. What to do? Has anyone found a solution? |
No sure if the same issue, also with M1 Macbook Pro. I have dual P2720U via single thunderbolt cable, replugging the cable sometimes fixes positioning. My issue is that macOs just switches around the displays. (1) is the left, and then afterwards (2) is the left display. ioreg shows the displays are nearly identical, except for a single number in the serial number ..
displayplacer shows the uuids from the system, and I believe macos is actually updating the Persistent screen ids and switching them around. Not sure if there's an option to go from Serial Number to Persistent Screen ID... |
i think if you run displaytracer list it even gives you an example command using the id. its certainly how i've got mine working. |
Yeah, the issue is, the persistent screen ids switch displays 😃 |
Same problem. Occasionally two monitors switch UUIDs and screw up the command I use, I have to switch settings on them each time. On M1 Max, one monitor is plugged in via HDMI, one is plugged in via USB-C using HDMI => USB-C cable |
@jakehilborn |
I think I found a way to link the monitors built-in serial number to the "Contextual screen id" that displayplacer reads from the quartz graphics layer. MacOS' system_profiler SPDisplaysDataTypesystem_profiler SPDisplaysDataType -json | jq '[ .SPDisplaysDataType[].spdisplays_ndrvs[]? |
{ _name: ._name,
"spdisplays_display-serial-number": ."spdisplays_display-serial-number",
_spdisplays_displayID: ._spdisplays_displayID,
"_spdisplays_display-week": ."_spdisplays_display-week",
"_spdisplays_display-year": ."_spdisplays_display-year",
_spdisplays_pixels: ._spdisplays_pixels,
_spdisplays_resolution: ._spdisplays_resolution,
}
] ' [
{
"_name": "Color LCD",
"spdisplays_display-serial-number": null,
"_spdisplays_displayID": "4281006",
"_spdisplays_display-week": "16",
"_spdisplays_display-year": "2017",
"_spdisplays_pixels": "3360 x 2100",
"_spdisplays_resolution": "1680 x 1050"
},
{
"_name": "LEN LT3053pwA",
"spdisplays_display-serial-number": "V1188942 ",
"_spdisplays_displayID": "2b982909",
"_spdisplays_display-week": "43",
"_spdisplays_display-year": "2013",
"_spdisplays_pixels": "2560 x 1600",
"_spdisplays_resolution": "2560 x 1600 @ 60.00Hz"
},
{
"_name": "LEN LT3053pwA",
"spdisplays_display-serial-number": "V1187020 ",
"_spdisplays_displayID": "2b98290a",
"_spdisplays_display-week": "41",
"_spdisplays_display-year": "2013",
"_spdisplays_pixels": "2560 x 1600",
"_spdisplays_resolution": "2560 x 1600 @ 60.00Hz"
}
] note the trailing whitespaces at the end of the serial number json --> csv --> markdown shenanigans ➜ system_profiler SPDisplaysDataType -json | jq '[ .SPDisplaysDataType[].spdisplays_ndrvs[]? |
{ _name: ._name,
"spdisplays_display-serial-number": ."spdisplays_display-serial-number",
_spdisplays_displayID: ._spdisplays_displayID,
"_spdisplays_display-week": ."_spdisplays_display-week",
"_spdisplays_display-year": ."_spdisplays_display-year",
_spdisplays_pixels: ._spdisplays_pixels,
_spdisplays_resolution: ._spdisplays_resolution,
}
] ' | jq -r '(map(keys) | add | unique) as $cols | map(. as $row | $cols | map($row[.])) as $rows | $cols, $rows[] | @csv' | csv2md
the ➜ echo $((16#2b98290a))
731392266
convert using bash: displayplacer
731392266 should be on the left side of 731392265 I saw that quartz can extact the monitors serial number. |
@FloWi This doesn't work for me, here's the output from system_profiler:
|
But, I can retrieve the real serial number via ioreg: see AlphanumericSerialNumber, it's only different by a single number!
|
I noticed that on my system it's called Does displayplacer use your |
lol - when I run your command I get the audio information about my monitors :D ioreg -lw0 | grep LT305
| | | | | "IOAudioEngineDescription" = "LEN LT3053pwA"
| | | | | | "IOAudioSelectorControlAvailableSelections" = ({"IOAudioSelectorControlTransportValue"=1685090932,"IOAudioSelectorControlSelectionValue"=876114020,"IOAudioSelectorControlSelectionDescriptionKey"="LEN LT3053pwA"})
| | | | "IOAudioEngineDescription" = "LEN LT3053pwA"
| | | | | "IOAudioSelectorControlAvailableSelections" = ({"IOAudioSelectorControlTransportValue"=1685090932,"IOAudioSelectorControlSelectionValue"=876114020,"IOAudioSelectorControlSelectionDescriptionKey"="LEN LT3053pwA"}) |
Probably system difference how it's connected, I have two Benq daisy chained via TB4 on a M1 Macbook 14", OS is 12.2.1 |
I have M1 Max, with four separately connected Samsung monitors.
Using Incredibly frustrating. |
That's a bummer. I thought I was on track of finding the holy grail :-/ |
@xedin am mentioning you because you're the first guy I see on the Swift project, and am pretty desperate to figure this out, as Apple's issues regarding multiple monitor handles seem to go back years... can you please try to maybe direct the relevant team/individual in Apple onto this, or point us to someone who can address it? It's really unfortunate that some open source repo on life support is the closest thing to proper multi-monitor behaviour on macOS, I don't understand why it's been overlooked. Maybe if we get the right guy's attention on this area, we can put an end to the shortcomings that we see here. |
After I switched to M1 MacBook Pro the two monitor IDs swaps every time. The last saved displayplacer script not works next time after swapping. So I have two Automator scripts with different ID order and I run those alternately. When used script 1 last time, I have to run script 2 next time and so on. I have "MonitorSet1" and "MonitorSet2" Automator scripts and I can run those with Spotlight search very quick. Because Spotlight shows the last used one in the first row, I always choose the second one. |
Just chiming in here to say I've got this same issue, on a 2022 M1 MacBook Pro on macOS 12.3.1 - I've got 2 HP Z27 monitors plugged in via Thunderbolt. After the mac sleeps, or I unplug the monitor(s), it'll come back with switched "persistent" IDs, and my layout won't work. |
twocs's solution is better: |
FYI |
@intellild @free-storage @thoro @bytejunkie @jpike88 @FloWi @CensoredUser @alagden 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? |
@jakehilborn ➜ displayplacer list | grep "Serial screen id"
Here is my config. system_profiler SPDisplaysDataType -json | jq . {
"SPDisplaysDataType": [
{
"_name": "Apple M1 Pro",
"spdisplays_mtlgpufamilysupport": "spdisplays_metal3",
"spdisplays_ndrvs": [
{
"_name": "Color LCD",
"_spdisplays_display-product-id": "a050",
"_spdisplays_display-serial-number": "fd626d62",
"_spdisplays_display-vendor-id": "610",
"_spdisplays_display-week": "0",
"_spdisplays_display-year": "0",
"_spdisplays_displayID": "1",
"_spdisplays_pixels": "3456 x 2234",
"_spdisplays_resolution": "1728 x 1117 @ 120.00Hz",
"spdisplays_ambient_brightness": "spdisplays_yes",
"spdisplays_connection_type": "spdisplays_internal",
"spdisplays_display_type": "spdisplays_built-in-liquid-retina-xdr",
"spdisplays_main": "spdisplays_yes",
"spdisplays_mirror": "spdisplays_off",
"spdisplays_online": "spdisplays_yes",
"spdisplays_pixelresolution": "spdisplays_3456x2234Retina"
},
{
"_name": "LEN LT3053pwA",
"_spdisplays_display-product-id": "60a4",
"_spdisplays_display-serial-number": "1010101",
"_spdisplays_display-vendor-id": "30ae",
"_spdisplays_display-week": "43",
"_spdisplays_display-year": "2013",
"_spdisplays_displayID": "2",
"_spdisplays_pixels": "2560 x 1600",
"_spdisplays_resolution": "2560 x 1600 @ 60.00Hz",
"spdisplays_mirror": "spdisplays_off",
"spdisplays_online": "spdisplays_yes",
"spdisplays_pixelresolution": "2560 x 1600",
"spdisplays_resolution": "2560 x 1600 @ 60.00Hz",
"spdisplays_rotation": "spdisplays_supported"
},
{
"_name": "LEN LT3053pwA",
"_spdisplays_display-product-id": "60a4",
"_spdisplays_display-serial-number": "1010101",
"_spdisplays_display-vendor-id": "30ae",
"_spdisplays_display-week": "41",
"_spdisplays_display-year": "2013",
"_spdisplays_displayID": "3",
"_spdisplays_pixels": "2560 x 1600",
"_spdisplays_resolution": "2560 x 1600 @ 60.00Hz",
"spdisplays_mirror": "spdisplays_off",
"spdisplays_online": "spdisplays_yes",
"spdisplays_pixelresolution": "2560 x 1600",
"spdisplays_resolution": "2560 x 1600 @ 60.00Hz",
"spdisplays_rotation": "spdisplays_supported"
}
],
"spdisplays_vendor": "sppci_vendor_Apple",
"sppci_bus": "spdisplays_builtin",
"sppci_cores": "16",
"sppci_device_type": "spdisplays_gpu",
"sppci_model": "Apple M1 Pro"
}
]
} I use that in my hacky python script to get the correct ordering of ids based on the week/year combo for hammerspoon. |
@jakehilborn @FloWi
displayplacer list | grep "Serial screen id" system_profiler SPDisplaysDataType -json | jq '[ .SPDisplaysDataType[].spdisplays_ndrvs[]? | |
Hi all, |
@ThBeS I think those values are immutable and set by macOS. You need to use those displayIDs in the programs. I use a hammerspoon script that hooks into the |
Hi FloWi, |
sure - don't have time to clean it up or put down much comments though. I'm also kinda happy it still works, because it was a hack ;-) Good luck! https://gist.github.com/FloWi/107ba7e80ea4411e8935da7cbc38df0e |
Display UUIDs sometimes not match physical screens
This is an Apple issue but I don't known how to report it to Apple
Maybe we could use display serial as a workaround?
The text was updated successfully, but these errors were encountered: