Using Xvfb I can launch an application and take a screenshot.
What I'm wondering about is how to capture from an existing (dormant) X session.
Say from tty or over ssh.
From what I understand windows are unmapped and does not exist to preserve resources. Are there some tool that can map existing windows, workspaces etc in a virtual windowmanager and take a snap?
Or can one perhaps use libx11 and create a snap by using XShmCreateImage or similar?

xwd -root | convert - /tmp/image.jpgwhat you are looking for? – jippie Dec 8 '12 at 21:31xwd -display :0 -root | convert xwd:- /tmp/0.png) – Sukminder Dec 8 '12 at 21:38