LoginSignup
1

More than 3 years have passed since last update.

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

Posted at

wmctrlをインストール

sudo apt install wmctrl

モニター間の移動

Screencast from 2019年05月04日 00時02分40秒 (2).gif
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

ウィンドウの最大化

Screencast from 2019年05月04日 00時03分03秒.gif
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

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