tags:

views:

300

answers:

1

I'd like to dump the contents of an X window. Like this:

xwd -id | convert - capture.png

... which works quite well as long as the target window is not hidden (totally or partially behind other windows) or minimized.

Any idea on how to do this?

I guess we somehow have to send a "repaint" signal to the hidden window and then capture its response or something... :)

+1  A: 

Do you have an objection to bringing it to the front first?

If not, you can use a tool like wmctrl to bring the window to the front (and maximize it, etc), use xwd to capture it, then send it back to where it came from with wmctrl.

Stobor