I'm wondering if there is any commands or programs to make some window maximized in X Window? For example, what I imagine is something like this
xmaximize -window *window_id*
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityI'm wondering if there is any commands or programs to make some window maximized in X Window? For example, what I imagine is something like this
xmaximize -window *window_id*
You can do this using wmctrl
.
Get your window's ID.
$ wmctrl -l
0x02a00004 0 grinchy saml@grinchy:~
0x0620004f 0 grinchy [gnome] Bash command for Maximizing and Unmaximizing windows in gnome? - Google Chrome
Then toggle window ID 0x0620004f
, like so.
$ wmctrl -i -r 0x0620004f -b toggle,maximized_vert,maximized_horz
here is a simpler way, just put this code in a script, and set executable with a keyboard shortcut. Works for me.
wmctrl -r :ACTIVE: -b toggle,maximized_vert,maximized_horz