#!/bin/bash RIGHT_ID="7A7FAED1-82FF-42D7-8D6F-32E397977EB2" DP="/opt/homebrew/bin/displayplacer" ROTATION=$($DP list displays | awk "/Persistent screen id: $RIGHT_ID/{flag=1} flag && /Rotation:/ {print \$2; exit}") echo "Current rotation is: $ROTATION" if [ "$ROTATION" = "0" ]; then $DP "id:$RIGHT_ID res:2560x1440 hz:100 color_depth:8 scaling:on origin:(0,0) degree:90" else $DP "id:$RIGHT_ID res:2560x1440 hz:100 color_depth:8 scaling:on origin:(0,0) degree:0" fi