Check out the X11 utilities, specifically xlsclients and xprop .
As an example, these are the shell commands that I used to get information about my firefox window:
id_=$(xlsclients -al|grep "Command: firefox-bin" -A1 -B4|head -n1|cut -d ' ' -f 2|tr -d ':') xprop -id "$_id"
Output:
SM_CLIENT_ID(STRING) = "1181f048b9000125508490000000037360008" WM_CLASS(STRING) = "firefox-bin", "Firefox-bin" WM_COMMAND(STRING) = { "firefox-bin" } WM_CLIENT_LEADER(WINDOW): window id # 0x0 _NET_WM_PID(CARDINAL) = 4265 WM_LOCALE_NAME(STRING) = "no_NO" WM_CLIENT_MACHINE(STRING) = "gnom.ifi.uio.no" WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified size: 10 by 10 WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING WM_ICON_NAME(STRING) = "firefox-bin" _NET_WM_ICON_NAME(UTF8_STRING) = 0x66, 0x69, 0x72, 0x65, 0x66, 0x6f, 0x78, 0x2d, 0x62, 0x69, 0x6e WM_NAME(STRING) = "Firefox" _NET_WM_NAME(UTF8_STRING) = 0x46, 0x69, 0x72, 0x65, 0x66, 0x6f, 0x78
source share