Gangmax Blog

Set the position and size of gnome-terminal

Basically the solution of this requirement is to add the “geometry” paramter to the “gnome-terminal” command line, but here I get a good way to know what’s the “geometry” parameter value you want from here.

First open a gnome-terminal window, resize the window and change the position as you like. When you think the size and position is OK, run the following command in the window:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
xwininfo -id $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')

Absolute upper-left X: 251
Absolute upper-left Y: 68
Relative upper-left X: 4
Relative upper-left Y: 23
Width: 1201
Height: 785
Depth: 24
Visual: 0x21
Visual Class: TrueColor
Border width: 0
Class: InputOutput
Colormap: 0x20 (installed)
Bit Gravity State: NorthWestGravity
Window Gravity State: NorthWestGravity
Backing Store State: NotUseful
Save Under State: no
Map State: IsViewable
Override Redirect State: no
Corners: +251+68 -148+68 -148-47 +251-47
-geometry 118x33+247-43

See the final line of the output “-geometry 118x33+247-43”? Then what you need to do is to modify your shortcut of gnome-terminal by using this information:

1
gnome-terminal --geometry=118x33+247-43

That’s it.

PS@20130822:

For the locked shortcut on the Unity dock of Ubuntu 12.04, if you want it have customized initial size, you can do it this way:

  1. Use “alacarte” to open the “gnome-terminal” shortcut and modify the command as above and save;

  2. Uncheck “Lock to Launcher” option of the shortcut on the dock;

  3. Start a “gnome-terminal” window and check “Lock to Launcher”;

  4. Done.

Comments