[comp.sys.next] Screen dimming/burn in

dmr@csli.Stanford.EDU (Daniel M. Rosenberg) (03/08/90)

Our loginwindow has begun burning into the screen, and the faint outlines of it
are already visible.

This happened even though the screen dims, because even the dimmed phosphors
can burn in, apparently. Is there a way we can 1) Dim the screen to 0%
automatically, instead of the 10% ot 20% it is now, or 2) Make our
loginwindow or whatever jump around?

Thanks for any pointers,
-- 
# Daniel M. Rosenberg     //  Stanford CSLI  // Eat my opinions, not Stanford's.
# dmr@csli.stanford.edu  // decwrl!csli!dmr // dmr%csli@stanford.bitnet

lane@sumex-aim.stanford.edu (Christopher Lane) (03/08/90)

In <12583@csli.Stanford.EDU>, dmr@csli.stanford.edu writes:
>Is there a way we can 1) Dim the screen to 0%
>automatically, instead of the 10% ot 20% it is now

Below is the source code for 'bright.c' a utility that I originally wrote for
0.8 & 0.9 which I've updated for 1.0 though it's slightly less functional (it
can't query the current setting due to changes by NeXT).

To totally dim the screen, you can use something like:

    if ( -o /dev/console ) bright 0

in your personal .logout file or in the /etc/logout.std file.  Or you could
use something like:

    if ( "`who | grep 'console'`" != '' ) bright 0

in a 'cron' entry/script that runs every hour, but I've not tested this.

- Christopher


#include <c.h>
#include <libc.h>
#include <sys/ioctl.h>
#include <nextdev/video.h>

#define	BRIGHT_MAX 0x3d /* MIN & MAX from <next/scr.h> */
#define BRIGHT_DEF 0x1f
#define	BRIGHT_MIN 0x00

typedef enum { PROGRAM, VALUE, ARGC } ARGUMENTS;

void error(char *string)
{
    perror(string);
    exit(EXIT_FAILURE);
}

void main(int argc, char *argv[])
{
	int value, device;

	if(argc != ARGC) {
		fprintf(stderr, "Usage:  %s value (%d <= value <= %d)\n",
			argv[PROGRAM], BRIGHT_MIN, BRIGHT_MAX);
		exit(EXIT_FAILURE);
		}

	if((device = open("/dev/vid0", O_RDWR, 0)) == CERROR) error("open");
	if(strncmp(argv[VALUE], "max", 3) == 0) value = BRIGHT_MAX;
	else if(strncmp(argv[VALUE], "min", 3) == 0) value = BRIGHT_MIN;
	else if(strncmp(argv[VALUE], "def", 3) == 0) value = BRIGHT_DEF;
	else value = atoi(argv[VALUE]);
	if(ioctl(device, DKIOCBRIGHT, &value) == CERROR) error("ioctl");
	if(close(device) == CERROR) error("close");

	exit(EXIT_SUCCESS);
}
-------