[comp.sys.next] Yet another way to dim your screen...

izumi@pinoko.berkeley.edu (Izumi Ohzawa) (05/31/91)

On my cube, the default auto-dimming doesn't lower the brightness
of the screen enough.  Although there are numerous screen dimmers,
most of them require you to run a process while dimming is in effect.
I don't want to run a process just to do screen dimming, especially
when there is an auto-dimmer built into loginwindow.
I looked for ways to lower the auto-dim brightness, and sure enough
found this in <nextdev/evsio.h>.
----
/* Device control ioctls.  Note that these set the current value
   but do not affect parameter RAM.  */

#define EVSIOSADB _IOW('e', 104, int)   /* Set AutoDim Brightness */
#define EVSIOCADB _IOR('e', 105, int)   /* Current AutoDim Brightness */
----

Running the program below once when you are logged in shows that the
default auto-dim brightness is 15, and this program will set it to 0,
making the screen A LOT dimmer than the standard setting.  The white
regions are faintly visible on some monitors, but it is dark enough for me.
Other monitors are completely blanked by this.
This is more-or-less what I wanted.

THE PROBLEM is that the auto-dim brightness is reset to 15 on
next workspace login.  It seems to persist after logout, though.

So, my questions today are:
[1] Does anybody know how one can make the auto-dim brightness value
permanent?

[2] Where is the "parameter RAM" the comment in evsio.h is referring to?


--- cut -- setautodim.c ---------------
#include <nextdev/evsio.h>
#include <libc.h>

int main( int argc, char **argv)
{
  int o_dim,n_dim;
  int evs=open( "/dev/evs0",O_RDWR);

  if ( evs < 0) {
    perror ("/dev/evs0");
    exit(10);
  }

  ioctl(evs, EVSIOCADB, &o_dim);
  printf("Current auto-dim brightness: %d, setting it to 0.\n", o_dim);
  n_dim = 0;
  ioctl(evs, EVSIOSADB, &n_dim);
  exit(0);
}
--- cut ---

---
Izumi Ohzawa             [ $@Bg_78^=;(J ]
USMail: University of California, 360 Minor Hall, Berkeley, CA 94720
Telephone: (415) 642-6440     Fax:  (415) 642-3323
Standard mail: izumi@violet.berkeley.edu
NeXTmail:      izumi@pinoko.berkeley.edu

louie@sayshell.umd.edu (Louis A. Mamakos) (05/31/91)

In article <1991May31.003447.9457@agate.berkeley.edu> izumi@pinoko.berkeley.edu writes:
>THE PROBLEM is that the auto-dim brightness is reset to 15 on
>next workspace login.  It seems to persist after logout, though.

Sounds like a job for a LoginHook/LogoutHook program, for lack of a 
permenent solution, like making the auto-dim level a preferences choice.  

I cannot imagine why the screen is just not blanked completely.

louie

eoshaugh@nmsu.edu (Erik Oshaughnessy) (05/31/91)

louie@sayshell.umd.edu (Louis A. Mamakos) writes:

[ Stuff about screen savers and auto-dim deleted ]

>I cannot imagine why the screen is just not blanked completely.

From what I have been told, there is a set of potentiometers inside
the case of the MegaPixel Display which control the characteristics of
the Display.  A friend of mine got fed up with the dull screen of his
Cube, so he cracked the Display open, and fiddled with the pots till
he had the desired screen brightness.

Disclaimer: I didn't actually see him do it, but his screen *is* much
            brighter than it was a while ago.


--
___________________________________________________________________________
Erik O'Shaughnessy Mac/Unix Support Guy	|Phrase of the day:  
Small Systems				|       "Poetically Inert"
New Mexico State University		|
eoshaugh@nmsu.edu			|"Help! I'm in ed!" - me
----------------------------------------------------------------------------

izumi@pinoko.berkeley.edu (Izumi Ohzawa) (06/01/91)

In article <1991May31.003447.9457@agate.berkeley.edu>
izumi@pinoko.berkeley.edu (Izumi Ohzawa) writes:

> I looked for ways to lower the auto-dim brightness, and sure enough
> found this in <nextdev/evsio.h>.
> ----
> /* Device control ioctls.  Note that these set the current value
>    but do not affect parameter RAM.  */
> 
> #define EVSIOSADB _IOW('e', 104, int)   /* Set AutoDim Brightness */
> #define EVSIOCADB _IOR('e', 105, int)   /* Current AutoDim Brightness */
> ----

[C code to lower Auto-dim Brightness deleted]

I realize that these ioctl's may only exist in Release 2.1.
It may not work under 2.0.

At the head of <nextdev/evsio.h>, there is a comment:

	22Dec90 Ted  Added EVSIOSADB and EVSIOCADB, autodim brightness ioctls. 

This date is after 2.0 release.

---
Izumi Ohzawa             [ $@Bg_78^=;(J ]
USMail: University of California, 360 Minor Hall, Berkeley, CA 94720
Telephone: (415) 642-6440     Fax:  (415) 642-3323
Standard mail: izumi@violet.berkeley.edu
NeXTmail:      izumi@pinoko.berkeley.edu

severyn@athena.ecs.csus.edu (Niles Severyn) (06/05/91)

Gee, that really sucks. Stupid LoginWindow!

Way back when, I wrote a program to bring the monitor brightness down
to zero, so that when people logged out, the monitor wouldn't be left
bright at all, for any length of time. This was annoying because you
had to rebright the monitor by hand to see what you were typing (of
course after you login, the way you left the monitor is restored, so
you don't have to bring it ALL the way up).

Anyway, I saw that program to change the dim level, and I figured that
would be WAAAAAAYYYY better, because then when you pushed a key you
could see immediatly.

So, I removed my "black" program from my /LocalApps/logoutexec file
and put in the program that sets the dimlevel to zero. Well, the
program works fine, except that STUPID LoginWindow resets the dimlevel
to 15 AND resets the dimtime to 30 MINUTES!!!! No wonder my slab at
home takes so long to dim after I log out! And I even have root set to
dim at 5 minutes here and at home!

Oh well, guess I'll have to go back to "black".

Jeff Kight <JKIGHT@auvm.auvm.edu> (06/05/91)

If you check out my source code for doze2, you will see that I change
the absolute time (in vertical refresh) of the loginwindow dimmer.

The default is 120600 (about 30 minutes), and I change it to 1 refresh
before I dim the screen to avoid the "automatic dimming" being
interpreted as a NeXTevent...

If anyone is interested...I wrote 2 pieces of code...evs and sevs that
let you see current evs settings and set them respectively...
---
Jeff Kight                                          jkight@auvm.auvm.edu
University Computing Center                           jkight@auvm.bitnet
The American University                                   (202) 885-2281
Washington DC  20016-8019