[comp.unix.sysv386] screen blanker?

pjh@mccc.uucp (Pete Holsberg) (10/02/90)

Is there a screen blanker for SV/386 R3.2?

Thanks,
Pete

-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
UUCP:...!princeton!mccc!pjh  1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     Trenton Computer Festival -- 4/20-21/91

tneff@bfmny0.BFM.COM (Tom Neff) (10/03/90)

In article <1990Oct1.220403.4429@mccc.uucp> pjh@mccc.uucp (Pete Holsberg) writes:
>Is there a screen blanker for SV/386 R3.2?

Yes, there is.  I am enclosing the source.

--- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- 

#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create:
#	screenblank
# This archive created: Wed Oct  3 10:17:15 1990
export PATH; PATH=/bin:/usr/bin:$PATH
if test -f 'screenblank'
then
	echo shar: "will not over-write existing file 'screenblank'"
else
sed 's/^X//' << \SHAR_EOF > 'screenblank'
X: use /bin/sh
X#	Copyright (c) 1984, 1986, 1987, 1988 AT&T
X#	  All Rights Reserved
X
X#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
X#	The copyright notice above does not evidence any
X#	actual or intended publication of such source code.
X
X#ident	"@(#)screenblank:screenblank.sh	1.19.1.7"
X
X#	Screen blanking script 
X
Xecho "\014\c"
SHAR_EOF
chmod +x 'screenblank'
fi
exit 0
#	End of shell archive

pjh@mccc.uucp (Pete Holsberg) (10/05/90)

In article <15910@bfmny0.BFM.COM> tneff@bfmny0.BFM.COM (Tom Neff) writes:
=In article <1990Oct1.220403.4429@mccc.uucp> pjh@mccc.uucp (Pete Holsberg) writes:
=>Is there a screen blanker for SV/386 R3.2?
=
=Yes, there is.  I am enclosing the source.
=
=--- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- CUT HERE --- 
=
=#! /bin/sh
=# This is a shell archive, meaning:
=# 1. Remove everything above the #! /bin/sh line.
=# 2. Save the resulting text in a file.
=# 3. Execute the file with /bin/sh (not csh) to create:
=#	screenblank
=# This archive created: Wed Oct  3 10:17:15 1990
=export PATH; PATH=/bin:/usr/bin:$PATH
=if test -f 'screenblank'
=then
=	echo shar: "will not over-write existing file 'screenblank'"
=else
=sed 's/^X//' << \SHAR_EOF > 'screenblank'
=X: use /bin/sh
=X#	Copyright (c) 1984, 1986, 1987, 1988 AT&T
=X#	  All Rights Reserved
=X
=X#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
=X#	The copyright notice above does not evidence any
=X#	actual or intended publication of such source code.
=X
=X#ident	"@(#)screenblank:screenblank.sh	1.19.1.7"
=X
=X#	Screen blanking script 
=X
=Xecho "\014\c"
=SHAR_EOF
=chmod +x 'screenblank'
=fi
=exit 0
=#	End of shell archive

That's very funny, Neff!  But, seriously, I'm looking for something that
will blank the screen after N minutes of no activity at the keyboard. 
Do you know of something like that?

Thanks,
Pete
-- 
Prof. Peter J. Holsberg      Mercer County Community College
Voice: 609-586-4800          Engineering Technology, Computers and Math
UUCP:...!princeton!mccc!pjh  1200 Old Trenton Road, Trenton, NJ 08690
Internet: pjh@mccc.edu	     Trenton Computer Festival -- 4/20-21/91

jpr@jpradley.uucp (Jean-Pierre Radley) (10/14/90)

In article <1990Oct4.191130.16902@mccc.uucp> pjh@mccc.edu (Pete Holsberg) writes:
> ... deleted ... suggestion from Tom Neff ...
>
>That's very funny, Neff!  But, seriously, I'm looking for something that
>will blank the screen after N minutes of no activity at the keyboard. 
>Do you know of something like that?

You could try SCRSAV.TXT in LIBrary 3 of CompuServe's UnixForum (which was
designed to blank a terminal's screen if there was no user logged in on that
terminal), and combine it with IDLER.C in LIB 9 of CIS' UnixForum (which was
designed to log a user off after a period of inactivity).

You'd then have your very own idleblank.c code...
-- 
 Jean-Pierre Radley          HIGH-Q	     jpr@jpradley	CIS: 72160,1341

tneff@bfmny0.BFM.COM (Tom Neff) (10/15/90)

By the way (to atone for my bogus 'screenblank.sh' silliness) somebody
DID write a UNIX screen blanker a while back, but I have *no* idea what
it was called.

You could write your own.  The idea is just

 * have a list of tty devices to check

 * periodically scan their access and modify times

 * when a tty goes "old" send it display-off (ANSI)

 * when a tty goes "new" send it display-on

There are various refinements you could make.  It should work for the
console at least.

-- 
"It has come to my attention that there is more  !!!  Tom Neff
than one Jeffrey Miller." -- Jeffrey Miller      ! !  tneff@bfmny0.BFM.COM

jbm@celebr.uucp (John B. Milton) (10/18/90)

In article <15957@bfmny0.BFM.COM> tneff@bfmny0.BFM.COM (Tom Neff) writes:
>By the way (to atone for my bogus 'screenblank.sh' silliness) somebody
>DID write a UNIX screen blanker a while back, but I have *no* idea what
>it was called.
>
>You could write your own.  The idea is just
>
> * have a list of tty devices to check
>
> * periodically scan their access and modify times
>
> * when a tty goes "old" send it display-off (ANSI)
>
> * when a tty goes "new" send it display-on
>
>There are various refinements you could make.  It should work for the
>console at least.

We have a wild collection of terminals, including a VT-100, two HP26xx, an
H-19, three uvt1224, two att605, and PCs running PCU. I put a list of the
ttys with terminals that need help blanking in /etc/ttyblank. The first
field is the name of the tty device, the second is the actual escape
sequence to send. To get around /dev/tty access problems, I only attempt
a screen blank if there is no one logged in.

:
# vi:set ts=2 sw=2:
while read i; do
	set $i
	if who -u|grep $1>/dev/null; then
		:
	else
		sh -c "echo \"$2\" > /dev/$1" &
		bpid=$!
		sleep 10
		kill $bpid
	fi
done </etc/ttyblank

Note that the "is someone logged in on this terminal" test is run just before
the screen blank sequence is sent out. Note that the echo command is put in
the background and killed 10 seconds later. This has to be done for terminals
that are blocked for one reason or another. This puppy gets run from cron
every 15 minutes. This is a crude hack, but it's been working for months with
no trouble.

As for a console screen blanker, it belongs in the kernel as a modification to
the kd stuff, complete with ioctl()s to control it. It would have to deal with
keypresses, normal unix terminal use, VP/ix or DOS-Merge and X servers.

I just reach over and turn down the brightness at night...

John
-- 
John Bly Milton IV, jbm@uncle.UUCP, n8emr!uncle!jbm@osu-cis.cis.ohio-state.edu
(614) h:252-8544, w:469-1990; N8KSN, AMPR: 44.70.0.52; Don't FLAME, inform!