Get window name using xprop

In X, if you run the xprop command and click on a window, it will print verbose details about the selected window. You can pipe this through a text processing program like awk to pick out particular details, such as the window name.

xprop |awk '/WM_CLASS/{print $4}'

In this example, if $4 doesn't work, try $3.

Last modified: 02/05/2006 (most likely earlier as a site migration in 2006 reset some dates) Tags:

Related Pages

Other pages possibly of interest:

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top