How do I get the number of windows displayed on an X server - X

This is a discussion on How do I get the number of windows displayed on an X server - X ; Hi All, I am an X newbie. I am using a X server ( on linux , HPUX , AIX etc ) and want to automate some tasks Is there a way I can get the number of windows displayed ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: How do I get the number of windows displayed on an X server

  1. How do I get the number of windows displayed on an X server

    Hi All,
    I am an X newbie. I am using a X server ( on linux , HPUX , AIX etc )
    and want to automate some tasks

    Is there a way I can get the number of windows displayed on an X
    server.
    Also can I start a program in such a way that it keeps listening like
    a server and whenever a new window opens up I can execute a function

    Thanks
    Ram

  2. Re: How do I get the number of windows displayed on an X server

    On Mon, 04 Oct 2004 05:30:02 -0700, Ramprasad Anantha Padmanabhan wrote:

    > Hi All,
    > I am an X newbie. I am using a X server ( on linux , HPUX , AIX etc )
    > and want to automate some tasks


    If you want to automate tasks take a look at the DCOP protocol. It's not
    supported everywhere nor by every application, but it's great for
    scripting.

    Regards,
    Steven.

  3. Re: How do I get the number of windows displayed on an X server

    Ramprasad Anantha Padmanabhan wrote:
    > Is there a way I can get the number of windows displayed on an X
    > server.


    The number of windows present on the DISPLAY according to X11 is
    apparently given by

    xwininfo -root -tree |grep '^ *0x'|wc -l

    But you might not call a window, what is a window for X; the number of
    direct children of the window with id 0x0 may be closer to what you
    want

    xwininfo -root -children |grep children

    But even those may not be actually visible at the moment. Windows can
    be unmapped, iconified, drawn off-screen, have one pixel size, be
    transparent, ...

    Daniel

+ Reply to Thread