#!/bin/bash LEFT_ID="F1A2D185-B386-4CEB-B155-1A44DDB883FD" DP="/opt/homebrew/bin/displayplacer" ROTATION=$($DP list displays | awk "/Persistent screen id: $LEFT_ID/{flag=1} flag && /Rotation:/ {print \$2; exit}") echo "Current rotation is: $ROTATION" if [ "$ROTATION" = "0" ]; then $DP "id:$LEFT_ID res:2560x1440 hz:60 color_depth:8 scaling:on origin:(-2560,0) degree:90" else $DP "id:$LEFT_ID res:2560x1440 hz:60 color_depth:8 scaling:on origin:(-2560,0) degree:0" fi