I have a seemingly common problem where when I dock my MacBook Pro in clamshell mode to my Thunderbolt 4 dock with 2 external displays, the displays are sometimes "flipped" meaning the left display shows up on the right, and vice versa. As a result, if I try to move my cursor from one display to the other, it gets "stuck" in the middle. The only way to fix this is to go into my System Preferences and flip the display arrangement on the Displays page. It's fine, but it's annoying. Is there a way to assign a keyboard shortcut to flip the display arrangement?
-
It's fine to answer your own question, & accept it as correct, but you need to split it into clear question and answer sections. [This may sound an odd thing to insist on if you're not used to Stack Exchange, but for future hits from google searchers this & some nice upvotes will prime google to bring your QA to the top.] As it stands, it's likely to be closed. Please take the time to take the Tour and read the Help pages, including Can I answer my own question?– TetsujinFeb 6 at 16:11
-
Fixed! Hope it can stay up, this post would have saved me so much time.– maxdoesFeb 6 at 16:22
-
1Looks good. Have some welcome points :)– TetsujinFeb 6 at 16:24
1 Answer
Here is the solution I have found!
Open Terminal
Install brew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install displayplacer
brew tap jakehilborn/jakehilborn && brew install displayplacer
Install iCanHazShortcut
brew install icanhazshortcut
Use macOS System Preferences to put displays in “correct” arrangement (System Preferences > Displays)
Use displayplacer to get “correct” display arrangement arguments using Terminal
displayplacer list
(scroll to bottom)
displayplacer "id:AB3507C3-C84E-4F19-9CC8-BA286B9FF967 res:1920x1080 hz:60 color_depth:7 scaling:on origin:(0,0) degree:0" "id:397A8EBB-E3B2-475D-8FF6-ED98E60B7B2C res:1920x1080 hz:60 color_depth:7 scaling:on origin:(1920,0) degree:0"
(This was mine, yours may be different.)
Use macOS System Preferences to put displays in a “flipped” arrangement (System Preferences > Displays)
Use displayplacer to get “flipped” display arrangement arguments using Terminal
displayplacer list
(scroll to bottom)
displayplacer "id:AB3507C3-C84E-4F19-9CC8-BA286B9FF967 res:1920x1080 hz:60 color_depth:7 scaling:on origin:(0,0) degree:0" "id:397A8EBB-E3B2-475D-8FF6-ED98E60B7B2C res:1920x1080 hz:60 color_depth:7 scaling:on origin:(-1920,0) degree:0"
(Again, yours may be different.)
- Open iCanHazShortcut and create a new shortcut for display arrangement #1. In the Command field, copy/paste the “correct” display arrangement arguments from above, replacing “displayplacer” with
/opt/homebrew/Cellar/displayplacer/1.2.0/bin/displayplacer
- Choose a keyboard shortcut (I chose Cmd+Ctrl+Shift+1)
- Create a new shortcut for display arrangement #2. In the Command field, copy/paste the “flipped” display arrangement arguments from above, replacing “displayplacer” with
/opt/homebrew/Cellar/displayplacer/1.2.0/bin/displayplacer
- Choose a keyboard shortcut (I chose Cmd+Ctrl+Shift+2)
- Test your setup. One keyboard shortcut should flip the displays so the cursor gets stuck in the middle. The other keyboard shortcut should put the displays in the correct arrangement and allow you to mouse the mouse freely between displays.
I hope this helps someone!
-
1