FacetTerm  
 
FacetCorp
 

Configuring Attached Printer as an LP Printer Through Ptys


Note: This procedure was tested with FacetTerm 3.0.6 on UNIX 5.4 going through a Dickens Terminal Server using the Bourne shell. You also need to be logged in as root or lpadmin. Other setups may require something different. Currently Sun OS 5.3 does not support lp pipes.

The FacetTerm utilities for configuring a printer attached to a terminal as a system printer, come out of the box expecting to be able to use the same physical tty line every time. This procedure describes how to use an attached printer on a terminal which connects up to the UNIX machine through non-fixed lines. This would include terminals going through a terminal server, ones dialing in through different modems, or any other method of connecting where the tty command might not report the same every time. After configuring FacetTerm to run fct_lpwin in the .facet file (see the Window #9 example within the default .facet file), follow these steps:

Step 1)

Set up an environment variable, $FCT_LPWINLP, for fct_lpwin to use. This can be done in your .profile, by adding the line:
   FCT_LPWINLP=danny; export FCT_LPWINLP
where fct_danny will be the name of the system printer. FCT_LPWINLP should be set to any tag that makes sense as a printer name, in this example we will use the user's name.

Step 2)

Modify the fct_lpwin utility (/usr/facetterm/bin/fct_lpwin) to use the $FCT_LPWINLP variable. Before making modifications to the script, make a backup copy of the original script, e.g., "cp fct_lpwin fct_lpwin.orig". With your editor comment out the lines and add the line as shown below:
             WINDOW_NUMBER=`$FCT_INFO window_number`
comment ==>  #TTYNAME=`$FCT_INFO ttyname`
comment ==>  #TTYNAME=`expr "$TTYNAME" : '.*/\(.*\)$'`
add     ==>  TTYNAME=$FCT_LPWINLP
             PIPE_NAME=fct_$TTYNAME
             #########################################
Step 3)

Create the system printer. Use fct_lpadmin as documented in the manual except in place of ttyname, use what $FCT_LPWINLP is set to. For example:
   fct_lpadmin -a danny -m standard

Your printer should be all configured. The next time you log in and run FacetTerm you should be able to print to the attached printer with "lp -d fct_danny filename".