1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

macOSの画面を左右2分割で表示する

Posted at

macOS自体に左右2分割で表示する機能がありますが、ウィンドウが全画面になってしまうのでちょっと使いづらい。
osascriptを使うと、ウィンドウの位置とサイズをコマンドラインから設定できるみたいなので、これを使ってみることにした。

align
# !/bin/sh

app=$1
align=$2

case $align in
  left )
    osascript \
      -e "tell application \"${app}\"" \
      -e 'set bounds of front window to {0, 23, 839, 1040}' \
      -e 'end tell'
    break
    ;;
  right )
    osascript \
      -e "tell application \"${app}\"" \
      -e 'set bounds of front window to {840, 23, 1680, 1040}' \
      -e 'end tell'
    break
    ;;
  * )
    echo "第2引数に left または right を入力してください" 1>&2
    ;;
esac

上記のスクリプトをパスの通った場所に置いて、

align Preview left
align Firefox right

とやると、こんな感じになる。

スクリーンショット 2019-01-15 22.12.32.png

参考: https://dev.classmethod.jp/smartphone/iphone/mac-app-resize/

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?