home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 January
/
usenetsourcesnewsgroupsinfomagicjanuary1994.iso
/
sources
/
misc
/
volume32
/
shlm
/
part01
/
condump.doc
< prev
next >
Wrap
Text File
|
1992-09-20
|
2KB
|
74 lines
CONDUMP(1) Unix Programmer's Manual CONDUMP(1)
NAME
condump - dump console screen
conrestore - restore console screen
SYNOPSYS
condump [ -cnv ] [ console_device ]
conrestore [ -cnv ] [ console_device ]
DESCRIPTION
condump copies the contents of the console screen to the
standard output. conrestore replaces the contents of the
console screen with standard input.
Normally, only the ASCII characters on the screen are
handled. The -v flag causes attribute bytes stored in
the video screen memory area to be handled as well.
The -n flag causes newlines to be placed at the end of
each line. The -c flag causes additional information to
be processed representing the current position of the cursor
on the screen. When using the previous output of condump
with conrestore, the conrestore flags used should be the same
used in comdump.
If condump(restore) is invoked from a terminal other than the
console, the console device must be supplied as standard input
(output), or on the command line.
NOTES
To use either program, you must have write permission on the
console device. This prevents non-root users from seeing the
the contents of another user's console screen.
Here's a sample screen-saver. It displays a user-supplied
program's output on to the screen after 15 minutes of console
inactivity. Note the use of the /etc/inittab comment field
by 'who' with 'grep' to find the console device even under shm.
See details in the shm documentation.
# ssaver - console screen saver
umask 077 # so one else can read it
TERM=AT386-M # my console TERM type
export TERM
PATH=/bin:/usr/bin:/usr/lbin # path to executables
while :
do
sleep 900 # 15 minutes
set `(who -u;who -l) | grep console`
DELAY=`echo $6 | cut -d: -f2`
if [ "$DELAY" -ge "15" ]
then screendump -vc > /tmp/$$ </dev/$2
clear > /dev/$2
# put your screen saver display program here
nice /usr/games/fireworks </dev/$2 >/dev/$2 &
# this just hangs until a single
# character is entered, see getkey.c
getkey </dev/$2 >/dev/null
kill -1 $!
screenload -vc </tmp/$$ >/dev/$2
rm /tmp/$$
fi
done
and add this line to /etc/inittab with a path to the above script:
ss:2:respawn:/bin/sh -c 'exec /usr/lbin/ssaver'
AUTHOR
Bruce Momjian, root%candle.uucp@bts.com Aug 12, 1992
condump version 1.1