0

I would like to programmatically determine all of the visible windows on the desktop so that i can place my window, if possible, so that it does not cover up other windows.

It is possible to do this using the wnck package (libwnck-3-dev, to be exact) on ubuntu 12.04.

However, in order to actually compile and link in code from wnck, you must define the symbol WNCK_I_KNOW_THIS_IS_UNSTABLE (you get a compile error otherwise).

This makes me think that this interface is not intended to be relied on.

The interface is very good (provides window name, geometry, whether the window is minimized or maximized, and other information) much more easily than raw xlib calls, and i think some information (minimization) is not even available from xlib.

But i would like to use a stable interface, as i don't want to have to reprogram everything a year down the road.

So: thanks in advance for any pointers to a preferred way of getting a list of windows, and determining the geometry (placement) of each, and the minimization state of each.

1 Answer 1

0

top 2 > RunningPrograms.text

The above command will output all the running programs to a text file in your home directory.

1
  • Thanks Naveen --- did you mean "top 2> x.text"? ("2" does not seem to be a valid argument to top.) If so, that would collect anything bound for stderr from top, but that's not exactly what i was looking for. I want not a list of programs, but a list of windows and their geometry, including when minimized. "xwininfo -root -tree > file.txt" would be along those lines, except that it doesn't show minimization, and i can get more info out of wnck anyway. What i really need to know is whether wnck is the recommended route, despite the defs required. Thanks!
    – dan
    Commented Oct 11, 2012 at 2:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .