May 132008
 


This is one of those not so technical tip but certainly the one we need when it comes to talk to Sun Support or creating a documentation. yes, its taking screenshots in Sun Solaris Operating Environment using CDE. Sun Solaris X utilities uses “xwd“, an application that is standard among the X utilities can be used to take screenshots. 

xwd dumps the output of a window into a file that can be viewed with xwud, or converted with convert (part of ImageMagick package), xv or another tool to a more usable image type, like png.



There are also more convenient tools to make a Screenshot. You should use more reliable import (part of ImageMagick package) instead of xwd.

To Take Screenshot of a Frame

When logged onto the CDE, open a terminal session and run the command as follows:

sunsolaris# xwd -frame > screenshot.xwd

This will prompt you to select a window (the cursor becomes a +), then it will take a picture of the window (as it appears on the screen), the “-frame” options will have it also include the window managers decorative borders, then the file is converted to png.

Fullscreen Screenshot

A full screen screenshot can be done without any frame being set

sunsolaris# xwd -root > screenshot.xwd

Screenshot and Convert togethor

sunsolaris# xwd -frame | convert xwd:- screenshot.png

Screenshot after “n” seconds

Now, comes the interesting bit, you can take screenshots after a delay time (say 10 seconds). All you do is to use a sleep command as follows

sunsolaris# sleep 10; xwd -root -out screenshot.xwd

To print the image captured using Laserjet


xpr -device ljet /tmp/myimage | lp -d printer

where “printer” is the installed printer.

This file can now be converted to PNG, JPG,GIF using GIMP or any other image editing software.

  2 Responses to “Howto Take Screenshots in Solaris 7/8/9/10 (CDE)”

  1. Looking for a way to switch users using CDE in a way that the first user doesn’t have to log out.
    In other words… can switch all of user 1’s processes to user 2, but then I need a way to let CDE know about the switch. Any one?

  2. I believe you can’t “switch user” unless you can start another X instance. You could ssh/rsh to localhost as a different user with X forwarding, that takes care of most needs. Xnest/Xvnc can be handy for full sessions.

    Systems with virtual consoles like Linux can start another X on another vc on certain setups, for example.

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)