Linux – How to get accurate window information (dimensions, etc.) in Linux (X)

linux

How can I get accurate window information in Linux? I know that I can use wmctrl to get a window's size, but the actual size of the window can vary due to window decorations. I need the following information and methods:

* precise window dimensions
* precise available screen space (excluding panels like gnome-panel)
* the ability to set a window to be a certain size, including decorations

What would be the best way to do this?

Thanks in advance!

Best Answer

There are some command line programs that might help:

  • xwininfo: It gets you the size of the window excluding the decoration and the position absolute (to the screen) and relative (to the area for windows)
  • xdpyinfo: This gives far more information about your screen-device, than you ever want to know about. But it has somewhere in the output something like screen: #0 followed by dimension: 1024x768.
Related Question