In a tab of a terminal emulator (lxterminal), I try to find out its window id by clicking in the tab and the process which "owns" the window (I am still not sure what is the word to describe the relation between a window and a process, so I use "own"), both by xwininfo

$ xwininfo -int | grep -Po '(?<=Window id: )[0-9a-zA-Z]+'
$ xdotool getwindowpid 31457283
$ ps aux | grep -i 1480
t         1480  0.1  0.3 473204 31240 ?        Sl   Nov21  23:18 lxterminal

and xdotool

$ xdotool selectwindow 
$ xdotool selectwindow getwindowpid
window 35652689 has no pid associated with it.

Why do xwininfo and xdotool give me different window ids, and thus different process results?



I just came across a launching script for a VNC client at work (sorry, cannot disclose details) that uses xdotool, the two relevant lines being -

w=`xdotool search --name "$VNC_client"`; x=`printf 0x%x $w`; qtembed $x

So I suspect from the format conversion specifier (in the printf) that there's a good chance that the different numbers are due to the simple difference in radix used to report their results.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.