home | codereading | contact | math | misc | patches | tech


xwd notes

Screenshot with xwd

To take a screenshot of a specific window, use the command:

$ xwd > /tmp/shot.xwd

The mouse cursor will change and you should click on the window you want a screenshot from.

If you need something to make a screenshot of something you have to click, it is not possible to use this method because this click (after the mouse cursor change) may hide what you want to get, like menus. To do that, use the command:

$ sleep 3; xwd -id <id> > /tmp/shot.xwd

The <id> parameter is the window id you want to take a picture from. This id can be got with the xwininfo command. sleep gives you time to open whatever element in the window you want (menus, select itens etc.). With the -id parameter, it is not necessary to click on the window.

Remember that xwd outputs pictures in a dump file and you will need a graphical application (e. g. xv, gimp etc.) to convert it to more known formats (png, jpg etc.)