[prog] listing window IDs
Akkana Peck
akkana at shallowsky.com
Sat Feb 27 23:33:31 UTC 2010
Miriam English writes:
> Hi all,
>
> I want to use ImageMagick to grab a window in an automated way. If I use
> ImageMagick's "import" command it waits for me to select (with a
> mouse-click) the window that I want the screenshot of. But ImageMagick
> can also use other commands, like "display" or "convert" to take their
> input from X. For example "display x:SeaMonkey" will display a
> screen-grab image of the window that is named "SeaMonkey".
>
> Anybody know of a Linux command to list all the window IDs as a text
> file? Also, if two windows have the same title, do you know if it is
> possible to distinguish between them?
xlsclients -l will do it -- it gives you window IDs that you can
pass to import.
If you need to tell several windows apart, you can use programs like
xwininfo or xprop, with -id and the ID you got from xlsclients,
to get more information about the window, like its size and location
on the screen. That should give you enough info to tell them apart.
...Akkana
More information about the Programming
mailing list