Skip to content

Instantly share code, notes, and snippets.

@mikkame
Created April 16, 2021 12:19
Show Gist options
  • Save mikkame/46c2d4a6626f33e0173068408fb568a8 to your computer and use it in GitHub Desktop.
Save mikkame/46c2d4a6626f33e0173068408fb568a8 to your computer and use it in GitHub Desktop.
首が痛くならないshell script
COUNT=0
DISPLAY_HEIGHT=2180
DISPLAY_WIDTH=3840
WINDOW_WIDTH=1920
WINDOW_HEIGHT=1080
R=300
CX=`expr $DISPLAY_WIDTH / 2 - $WINDOW_WIDTH / 2`
CY=`expr $DISPLAY_HEIGHT / 2 - $WINDOW_HEIGHT / 2`
while true;
do
COUNT=`expr $COUNT + 5`
DEG=`echo "$COUNT % 360" | bc`
RX=`echo "(c($DEG * 3.14 / 180) * $R) + $CX" | bc -l | awk '{printf("%d\n",$1)}'`
RY=`echo "(s($DEG * 3.14 / 180) * $R) + $CY" | bc -l | awk '{printf("%d\n",$1)}'`
osascript \
-e 'tell application "Terminal"' \
-e "set position of front window to {$RX, $RY}" \
-e 'end tell'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment