-
Notifications
You must be signed in to change notification settings - Fork 135
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
Swap the positions of two monitors by contextual screen id. #80
Comments
Got a lead via this line:
Took some time to figure out just how would you do that? Contextual screen id does not seem to be acceptable.
Finally I figured out it could be done like: Apparently the res, scaling, and degree are all mandatory (even though I have no desire to change them) because this cannot work: Interestingly I can leave a whole monitor out of the command and it works fine. Just don't forget to every time degree:0. |
I have the same issue. Two monitors with external dual HDMI switch. With Intel Mac the two screens always swapped, but with stored displayplacer command I could restore. But then I switched to the M1 MacBook 16 things get more strange. The screens swapped as well, BUT the display IDs swapped too!! So, when I saved the displayplacer command, it doesn't worked next time. So I have two Automator script "MonitorSet1" and "MonitorSet2". A always runs alternately. If I used "MonitorSet1" the last time, I have to run "MonitorSet2" next time, and so on. Very strange, but works. With Spotlight search I can run those very quick. |
Yes, that's what's happening to me. The monitors are the same, also on the M1 MacBook 16, but the IDs swap around from monitor to monitor. One monitor will be CCE4 and the sefond is 11AC, but on wake the other monitor is CCE4 and the first monitor is 11AC. I'm sure you know which set to switch to by now, but you can also make the two into a single Automator script to swap two monitors by id like this (note: use your own IDs, not mine). |
Genius! Thank you |
Same case here. I have 2 identical external displays with their ID swapping randomly. A Thank you @twocs BTW: I'm using fish shell. Here is the command I use:
|
I am not a coder and none of this stuff makes much sense. I have the same problem many of you have stated. M1 chip, 2 monitors that dont remember the arrangement, background color or screen saver after reboot, log out and sleep. I have not installed displayplacer I am hoping someone experienced can reach out and kindly guide me through it. thanks so much. Popsi |
Here's my workaround to swap position of two displays set to the same resolution (so if you have 3 displays, like a laptop built-in and 2 external, it won't swap an external with the laptop, unless they are set to the same resolution, in which case you will need additional regex customization): echo "displayplacer list | tail -n1 | sed 's/displayplacer //;s/id:\(.\{36\}\) res:\([0-9x]\{7,9\}\) \(.*\)id:\(.\{36\}\) res:\2/id:\4 res:\2 \3id:\1 res:\2/g' | xargs displayplacer" > swap_display.sh
chmod +x swap_display.sh Execution: ./swap_display.sh Works for me on an M1 Max running macOS 12.5.1 and displayplacer v1.2.0. Best of luck! |
I repurposed @alxw's command and turned it into a global shortcut, so that it's just a keypress away whenever I need it. Here's some instructions: Create a new Shortcut in the Shortcuts app, of type "Run Shell Script", which should run this command:
Leave all other options as they are. The shortcut should look like this: Then, under the Settings (top right corner), check "Use as Quick Action" and "Services Menu": Finally, close the Shortcut window and in the main window, rename the Shortcut to "Swap Displays": Now, open System Preferences from the Apple logo on the top left corner, and go to Keyboard > Shortcuts > App Shortcuts. Press the + button to add a new shortcut, name it the exact same thing you named the Shortcut, and give it a key combination (in my case, I chose Control+Command+S). Once you save it, you can now press Ctrl+Cmd+S to swap the positions of your two identical external screens. As @alxw mentioned, if your setup is not two identical screens + the laptop display, you might have to play around with the Hope this helps, at least until Apple decides to fix this most annoying of bugs. |
@twocs @westito @ByScripts @PopsicleStyx @alxw @eugeneromero 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? |
I actually haven't had to adjust monitors since the new Mac os update
…On Sun, Jun 11, 2023, 4:14 PM Jake Hilborn ***@***.***> wrote:
@twocs <https://github.com/twocs> @westito <https://github.com/westito>
@ByScripts <https://github.com/ByScripts> @PopsicleStyx
<https://github.com/PopsicleStyx> @alxw <https://github.com/alxw>
@eugeneromero <https://github.com/eugeneromero> displayplacer v1.4.0
<https://github.com/jakehilborn/displayplacer/releases> 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?
—
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AT4JFX2OTKW4EE5D5TC3VUDXKYYNHANCNFSM5RPWINVA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I have three monitors, all the same exact model and resolution. Mac keeps reassigning the "persistent id" on wakeup, so the command cannot work (I see other open issues also related). All I want to do is swap monitor #2 with monitor #3.
I can do this with some CLI work with SED and swap the IDs in the command output, but
displayplacer list
is so chatty. It doesn't simply output the "command below", but it also emits instructions and a bunch of other stuff.displayplacer list | grep displayplacer
outputs two lines of possible commands:What I'd really like is a command like
displayplacer swap --contextual_screen_id 2 3
Some suggestions:
displayplacer list -l
could listScreens(), anddisplayplacer list -p
could limit it to printCurrentProfile() (preferably without extraneous comments like "Execute the command below to set your screens to the current arrangement").displayplacer list --contextual-screen-ids
would output contextual ids rather than the "permanent" ones that my Mac keeps switching.Poking around I also found the undocumented commands:
displayplacer --version
displayplacer --help
Shouldn't they be in the Readme? The instructions are very brief in the Readme. Not sure what to do to get some traction on this. Sorry if this issue sounds is a bit vague but I'm really not clear on what to do.
The text was updated successfully, but these errors were encountered: