[Ubuntu 19.04]ウィンドウを自動で最大化したりモニターを移動する


wmctrlをインストール

sudo apt install wmctrl

モニター間の移動


YouTube

wmctrl -r Chrome -e 0,1920,-1,-1,-1

1920(左のモニターの横幅)はX座標。
Chromeはウィンドウのタイトルの一部を指定。

# ウィンドウのタイトル一覧
wmctrl -l
0x03001c9c  0 desktop disco@desktop: ~/Downloads
0x0240003a  0 desktop wmctrl(1) - Linux man page - Google Chrome
0x0240005d  0 desktop 「[Ubuntu 19.04]ウィンドウを自動で最大化したりモニターを移動する」を編集 - Qiita - Google Chrome

ウィンドウの最大化


YouTube

wmctrl -r Chrome -b add,maximized_vert,maximized_horz

ウィンドウの最小化

wmctrl -r Chrome -b remove,maximized_vert,maximized_horz

引用

Move Active Window to Different Screen (dual head)
https://ubuntuforums.org/archive/index.php/t-1045417.html

How to close, minimize, and maximize a specified window from Terminal?
https://askubuntu.com/questions/703628/how-to-close-minimize-and-maximize-a-specified-window-from-terminal