<div dir="ltr">I ended up giving that xterm a distinct title. Using "xterm -T <some-distinct-title>". Then with the xdotool could find its id "xdotool search -name <some-distinct-title>".<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 12, 2024 at 2:02 PM Carsten Haitzler <<a href="mailto:raster@rasterman.com">raster@rasterman.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, 10 Feb 2024 15:53:39 +0300 Riza Dindir <<a href="mailto:riza.dindir@gmail.com" target="_blank">riza.dindir@gmail.com</a>> said:<br>
<br>
> Hello,<br>
> <br>
> I am starting xterm in my xinitrc. Is it possible to get the window id of<br>
> that xterm?<br>
> <br>
> Regards<br>
<br>
echo $WINDOWID<br>
<br>
(in the xterm itself).<br>
<br>
But I suspect this is not what you want... and no - there is no reliable way of<br>
getting a window id from some app you ran - the window ID is runtime assigned<br>
and can be anything. An app can open multiple windows (and often creates<br>
invisible windows you never see and sub windows etc.<br>
<br>
A large number of apps will set a _NET_WM_PID property on the window with the<br>
PID of the process that created the window - but not all. xterm does do this.<br>
Apps may set the WM_COMMAND property with the command that launched them (and<br>
any arguments). WM_CLASS may provide some hints as to the app that owns the<br>
window. you might have to follow the breadcrumbs and look at the window id<br>
referenced by WM_CLIENT_LEADER to get some of these properties.<br>
<br>
<br>
-- <br>
------------- Codito, ergo sum - "I code, therefore I am" --------------<br>
Carsten Haitzler - <a href="mailto:raster@rasterman.com" target="_blank">raster@rasterman.com</a><br>
<br>
</blockquote></div>