screen blanker?

John B. Milton jbm at celebr.uucp
Thu Oct 18 17:28:36 AEST 1990


In article <15957 at bfmny0.BFM.COM> tneff at 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 at uncle.UUCP, n8emr!uncle!jbm at osu-cis.cis.ohio-state.edu
(614) h:252-8544, w:469-1990; N8KSN, AMPR: 44.70.0.52; Don't FLAME, inform!



More information about the Comp.unix.sysv386 mailing list