Window id of xterm started

Riza Dindir riza.dindir at gmail.com
Mon Feb 12 11:06:36 UTC 2024


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>".

On Mon, Feb 12, 2024 at 2:02 PM Carsten Haitzler <raster at rasterman.com>
wrote:

> On Sat, 10 Feb 2024 15:53:39 +0300 Riza Dindir <riza.dindir at gmail.com>
> said:
>
> > Hello,
> >
> > I am starting xterm in my xinitrc. Is it possible to get the window id of
> > that xterm?
> >
> > Regards
>
> echo $WINDOWID
>
> (in the xterm itself).
>
> But I suspect this is not what you want... and no - there is no reliable
> way of
> getting a window id from some app you ran - the window ID is runtime
> assigned
> and can be anything. An app can open multiple windows (and often creates
> invisible windows you never see and sub windows etc.
>
> A large number of apps will set a _NET_WM_PID property on the window with
> the
> PID of the process that created the window - but not all. xterm does do
> this.
> Apps may set the WM_COMMAND property with the command that launched them
> (and
> any arguments). WM_CLASS may provide some hints as to the app that owns the
> window. you might have to follow the breadcrumbs and look at the window id
> referenced by WM_CLIENT_LEADER to get some of these properties.
>
>
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> Carsten Haitzler - raster at rasterman.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.x.org/archives/xorg/attachments/20240212/e5db3d7a/attachment.htm>


More information about the xorg mailing list