waydabber / BetterDisplay

Unlock your displays on your Mac! Flexible HiDPI scaling, XDR/HDR extra brightness, virtual screens, DDC control, extra dimming, PIP/streaming, EDID override and lots more!
https://betterdisplay.pro
20.83k stars 364 forks source link

Add support for "main" and "secondary" as nicknames for addressing a display using CLI #3622

Open thalesmello opened 2 weeks ago

thalesmello commented 2 weeks ago

Borrowing this idea from Aerospace, where you can use "main" to target the main display, and "secondary" to refer to the other display when there are only two of them connected.

Likewise, it can be sometimes confusing to find exactly the names of displays when you want to quickly write a one-off command, as I do all the time when I plug in my laptop into different displays. It would be convenient to use "main" and "secondary" as targets.

For the time being, I'm making do with the following command line to move the secondary display to the bottom of my main display:

betterdisplaycli perform "--originalName=$(osascript -e 'tell application "System Events" to display name of desktop 2')" "--targetOriginalName=$(osascript -e 'tell application "System Events" to display name of desktop 1')" --moveTo=bottom
waydabber commented 2 weeks ago

@thalesmello - indeed, this would be an useful addition. Will implement.