Hi Sun Managers,
My original posting was as follows:
>Hi Sun Managers,
>
>Does anybody know of a way to print the contents of the screen from within
>openwindows similar to the way it is done with PCs (i.e Shift Print Screen).
>I know that snapshot does the job but I want to know if there is a way to do
>it using the Print Screen key on a Sun type 5 keyboard.
>
>The system is as follows :
>
>Sun Sparcstation 1
>SunOs 4.1.3
>openwindows 3.0
As usual with this group I got a lot of helpful responses. I used the
folowing command:
"xwd -frame | xpr -device ps | lpr".
I then mapped the command to the F12 key by adding the following entry to my
.ttyswrc (you need to log out then log back in) :
mapi F12 $OPENWINHOME/bin/xwd -frame | $OPENWINHOME/bin/xpr -device ps | lpr
Thanks plenty to all who responded. Below are the responses that I
received:
---------------------------------------------------------------------------
From: rr6204@moses.ca.boeing.com (Bob Rutherford)
Here is a command I use as a screen menu that you could tie to the keyboard:
sh -c "get_selection | lpr
You have to highlight the text you want printed first.
---------------------------------------------------------------------------
>From pasken@newton.slu.edu.
Use xmodkeymap to bind "xwd | xpr -d postscript | lpr" to the
printscreen key. This causes the cursor to change to a cross-hair and
the terminal to beep once, pressing the left mouse button copies the
window the cursor is in and dumps it to the printer. When the screen
beeps twice it's finished and you can continue. You also could alias
the string of characters that the print screen key is to do the same
thing
---------------------------------------------------------------------------
From: bdicaire@vpet.hydro.qc.ca (Benoit Dicaire)
I have this alias in my .cshrc ...
snap /usr/local/soft/openwin/bin/xwd -frame|/usr/local/soft/openwin/bin/xpr -device ps -portrait|lpr -Pps -h
Try it, I don't know if you can bind the command to a key.
---------------------------------------------------------------------------
From: rwh@atmos.albany.edu (Ronald W. Henderson)
Afwa:
Highlight the data in the screen. Use the get_selection command and
pipe it to the printer of choice:
Example: get_selection | lpr _Plp0
---------------------------------------------------------------------------
From: root@wisdom.maf.nasa.gov (Mark Hargrave (504) 257-1242)
Afwa,
You can map commands to you keys on the keyboard by creating a file
called .ttyswrc .
Here is an example:
mapi R1 ps -aux | more\n
mapi R6 ls -lR | more\n
So, you can map the snapshot command to anyony of you keys.
Ony more thing, don't forget to logout and log back in for
the .ttyswrc to get invoked.
---------------------------------------------------------------------------
From: Salvatore Saieva <merccap!clark!saieva@uunet.uu.net>
Check out the commands xwd, xdpr, and xwd2ps.
---------------------------------------------------------------------------
Afwa Kandawire
**************************************************************************
*Asst UNIX System Administrator Tel No.: (212)650-6181 *
*Computer Science Department e-mail : afwa@cs-mail.engr.ccny.cuny.edu*
*City College Of New York *
**************************************************************************
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:09:10 CDT