There may be situations where-in you need to fetch detailed information about an application window on your Linux system. For example, the requirement might be to get the size and position of the window.
If you are looking for an easy way to get this type of information, you'll be glad to know that there exists a tool that's specifically built for this purpose. In this tutorial, we will quickly discuss how to use the tool and what kind of output it produces.
But before that, it's worth noting that all the commands and instructions mentioned in this article have been tested on Ubuntu 14.04LTS.
Get window details using xwininfo
Yes, xwininfo is the tool that'll help you in this case. It's basically a window information utility for X (or X-Windows system). Here's how the tool's man page explains it:
"Xwininfo is a utility for displaying information about windows. Various information is displayed depending on which options are selected. If no options are chosen, -stats is assumed."
To use the tool, just run the following command:
As you can see in the screenshot above, the tool asks you to select the window for which you want to fetch the information. Once you do that, an output similar to the following is produced:
So you can see that the tool firstly tells you the id and description of the window you clicked, followed by a lot of details about that window. Some of these fields are explained here. There's also an xwininfo-related bug, check it out by heading here.