9

in X I know you can get the geometry of a window with xwininfo.

Unfortunately, if i retrieve such geometry from a gnome-terminal and use that to start another one with gnome-terminal --geometry ..., the two windows' top and left don't match.

Indeed, the new terminal is south-east shifted by the width and height of the old terminal's window decoration.

How can I start a new terminal that completely overlaps a first one?

Barett
  • 5,826
  • 6
  • 51
  • 55
etuardu
  • 5,066
  • 3
  • 46
  • 58
  • Probably your window manager or Compiz is interfering. On Ubuntu with Unity it works perfectly for me (using the geometry line from xwininfo) provided that the terminal is not where the menu bar would be. – Sam Brightman Aug 27 '11 at 00:22
  • https://bugs.launchpad.net/ayatana-design/+bug/723878 – Sam Brightman Aug 27 '11 at 00:31

1 Answers1

17

I can propose you a workaround for this problem which is working for me. First of all you obtain the geometry of the window with the following command:

xwininfo -id $(xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}')

You will get something like this:

  Absolute upper-left X:  783
  Absolute upper-left Y:  344
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 722
  Height: 434
  Depth: 32
  Visual: 0x76
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x4400005 (not 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:  +783+344  -175+344  -175-272  +783-272
  -geometry 80x24+775+315

Neither the information in the -geometry 80x24+775+315 section nor the information in Absolute upper-left X: 783 and Absolute upper-left Y: 344 allows you to launch a gnome-terminal in the same position than the current on. You have to mix both data to get the appropriate information.

gnome-terminal --geometry=80x24+783+315

Note: I have check this under Ubuntu 11.10 | Unity

Alberto
  • 553
  • 6
  • 14
  • 1
    I tested with Ubuntu 16.04, and the `-geometry` information I get worked as is although it looks different: `-geometry 147x24--10-14`. It may be that they applied a form of a fix. In my case, it properly places my terminals at the bottom right corder as I expect. – Alexis Wilke May 25 '16 at 00:07