LoginSignup
4
2

More than 3 years have passed since last update.

WindowsみたいにMacでもショートカットキーで画面回転したい

Last updated at Posted at 2019-09-28

背景

windowsからmacに乗り換えてみて、ショートカットキーによる画面回転ができないことが微妙に不便だったのでなんとかしたいと思いました。

環境

・MacOS X Mojave 10.14
・Automatorバージョン2.9 (444.42)
・LG モニター 27UK850-W 27インチ

実装

(一応自己責任でお願いします)

step1:

次のコマンドを実行してdisplayplacer(CUIでディスプレイ設定を変更できる)を入れます。
brew tap jakehilborn/jakehilborn && brew install displayplacer

step2:

次のコマンドを実行して現在のディスプレイの情報を表示させます。
displayplacer list

色々情報が出ますが、必要なのは最後の一行です。
displayplacer "id:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx res:2560x1440 hz:60 color_depth:8 scaling:on origin:(0,0) degree:0"

これが現在のディスプレイ設定です。コピペしてそのまま実行しても何も変わらないのですが、例えばdegreeの値を90に変更して実行すると画面が回転します。
(もしかしたらディスプレイによってはうまくいかないかもしれないです。ちなみに私の環境だと半回転した状態からもとの状態に戻すとき何故か“Screen ID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx: could not find res:2560x1440x60 color_depth:8 scaling:off”というエラーがでます。でも回転自体はできてるからとりあえずOK)

step3:

MacのAutomator→クイックアクションでスクリプト登録します。
スクリーンショット 2019-09-28 17.23.14.png

"スクリプト"等で検索して"シェルスクリプトを実行"を選択します。
"ワークフローが受け取る項目:"を"入力なし"に設定して"シェルスクリプトを実行"の欄にdisplayplacerのスクリプトを貼り付けて保存します。私はdegree0という名前で保存しました。
スクリーンショット 2019-09-28 17.24.18.png

同様にdegree:270にしたスクリプトも登録します。

step4:

システム環境設定 → キーボード → ショートカット → サービスで上記で登録したサービスのショートカットを登録します。(私はcommand+control+←で270°回転、command+control+↑で0°回転になるようにしてます)
スクリーンショット 2019-09-28 17.21.43.png

実演

ezgif-3-49b280172492.gif

最後に

もっと良い方法あったら教えてね。

4
2
1

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
4
2