Bill Jonas on Fri, 8 Nov 2002 16:00:06 +0100 |
On Thu, Nov 07, 2002 at 10:20:28PM -0500, W. Chris Shank wrote: > Anyone know how I can take a screenshot of the GDM graphical greeter > (aka: login screen)? xwd(1) I just noticed from playing around with it that you may need to actually switch to the X display in question in order to have a usable picture. I'm not sure if this is true in the general case or if it's just true for my particular video card/X server combination or because I have DRI enabled or what. In any case, the following command worked for me: $ sleep 2; xwd -display :0.0 -out dump.xwd -root (Note that the "sleep 2" only gave me barely enough time to switch to the X display so that I wouldn't get a garbled image.) In any case, xwd(1)'s output isn't a very common graphics format: $ file dump.xwd dump.xwd: XWD X-Windows Dump image data, "xwdump", 1280x1024x16 But display(1) and convert(1) ("apt-get install imagemagick" or http://www.imagemagick.org/ or your favorite provider of RPMs) grok it just fine. $ display dump.xwd $ convert dump.xwd dump.png $ ls -lh dump.* -rw-r--r-- 1 bj bj 34k Nov 8 09:23 dump.png -rw-r--r-- 1 bj bj 2.5M Nov 8 09:22 dump.xwd A former boss of mine, working with systems used in a kiosk application, used xwd(1) to good effect for monitoring the X display. Note that import(1), also from the ImageMagick package, will also do what you want. The difference is that you can specify any graphics format as the output (it determines which format you want from the output filename's extension), and the command-line format is slightly different. Also note that you may have the same garbling issue with import(1) if you had it with xwd(1). (Note that I didn't have the problem when the display was active and I ssh'd in from another host.) $ sleep 2; import -display :0.0 -window root import.png $ display import.png $ ls -lh import.png -rw-r--r-- 1 bj bj 122k Nov 8 09:36 import.png $ file import.png dump.* import.png: PNG image data, 1280 x 1024, 16-bit/color RGB, non-interlaced dump.png: PNG image data, 1280 x 1024, 8-bit colormap, non-interlaced dump.xwd: XWD X-Windows Dump image data, "xwdump", 1280x1024x16 Also note: If you don't have or don't want to install ImageMagick, the Gimp handles XWD-format graphics files just fine. HTH. -- Bill Jonas * bill@billjonas.com * http://www.billjonas.com/ "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -- Benjamin Franklin Attachment:
pgpFaW8Jzc6cg.pgp
|
|