Specifying X windows' geometry in the coordinates obtained from wmctrl
The --geometry
option for gnome-terminal
is actually measured in characters, rather than pixels. For example, to get an 80 column terminal only 10 lines high, you can launch gnome-terminal
like this:
gnome-terminal --geometry 80x10
The terminal will resize in increments of the font character size, which it communicates to the Xserver using WM_NORMAL_HINTS
. You can examine these using the xprop
command. For example, here I find a Terminal window id, and ask xprop about it:
$ wmctrl -lG | tail -n1
0x06400021 0 592 314 580 338 myhostname kees@myhostname: ~
$ xprop -id 0x6400021
...
WM_NORMAL_HINTS(WM_SIZE_HINTS):
program specified minimum size: 48 by 16
program specified resize increment: 7 by 14
program specified base size: 20 by 2
window gravity: NorthWest
...
In the above case, the font size is 7 by 14 pixels. So if I wanted a 70 by 140 pixel Terminal, I could run gnome-terminal --geometry 10x10
(though it would be 20 x 2 pixels larger than that based on the window manager decorations, etc, as seen in the "specific base size" above).