home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume32 / shlm / part01 / condump.doc < prev    next >
Text File  |  1992-09-20  |  2KB  |  74 lines

  1. CONDUMP(1)                 Unix Programmer's Manual                 CONDUMP(1)
  2.  
  3. NAME
  4.     condump    - dump console screen
  5.     conrestore - restore console screen
  6.  
  7. SYNOPSYS
  8.     condump [ -cnv ] [ console_device ]
  9.     conrestore [ -cnv ] [ console_device ]
  10.  
  11. DESCRIPTION
  12.     condump copies the contents of the console screen to the
  13.     standard output.  conrestore replaces the contents of the
  14.     console screen with standard input.
  15.  
  16.     Normally, only the ASCII characters on the screen are 
  17.     handled.  The -v flag causes attribute bytes stored in 
  18.     the video screen memory area to be handled as well. 
  19.     The -n flag causes newlines to be placed at the end of 
  20.     each line.  The -c flag causes additional information to
  21.     be processed representing the current position of the cursor
  22.     on the screen.  When using the previous output of condump
  23.     with conrestore, the conrestore flags used should be the same
  24.     used in comdump.
  25.  
  26.     If condump(restore) is invoked from a terminal other than the
  27.     console, the console device must be supplied as standard input
  28.     (output), or on the command line.
  29.  
  30. NOTES
  31.     To use either program, you must have write permission on the
  32.     console device.  This prevents non-root users from seeing the
  33.     the contents of another user's console screen.
  34.  
  35.     Here's a sample screen-saver.  It displays a user-supplied
  36.     program's output on to the screen after 15 minutes of console
  37.     inactivity.  Note the use of the /etc/inittab comment field 
  38.     by 'who' with 'grep' to find the console device even under shm. 
  39.     See details in the shm documentation.
  40.  
  41.         # ssaver - console screen saver
  42.         umask 077    # so one else can read it
  43.         TERM=AT386-M    # my console TERM type
  44.         export TERM
  45.         PATH=/bin:/usr/bin:/usr/lbin    # path to executables
  46.         while :
  47.         do
  48.             sleep 900         # 15 minutes
  49.             set `(who -u;who -l) | grep console`
  50.             DELAY=`echo $6 | cut -d: -f2`
  51.             if [ "$DELAY" -ge "15" ]
  52.             then    screendump -vc > /tmp/$$ </dev/$2
  53.                 clear > /dev/$2
  54.                 # put your screen saver display program here
  55.                 nice /usr/games/fireworks </dev/$2 >/dev/$2 &
  56.                 # this just hangs until a single 
  57.                 # character is entered, see getkey.c
  58.                 getkey </dev/$2 >/dev/null
  59.                 kill -1 $!
  60.                 screenload -vc </tmp/$$ >/dev/$2
  61.                 rm /tmp/$$
  62.             fi
  63.         done    
  64.  
  65.  
  66.     and add this line to /etc/inittab with a path to the above script:
  67.  
  68.         ss:2:respawn:/bin/sh -c 'exec /usr/lbin/ssaver'
  69.  
  70. AUTHOR
  71.     Bruce Momjian, root%candle.uucp@bts.com      Aug 12, 1992
  72.     condump version 1.1
  73.  
  74.