[comp.sys.next] Doze2 - NeXTevent Sensitive ScreenDimmer

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

What makes Doze2 different from other screen savers/dimmers?

- Does not use the loginwindow's LoginHook/LogoutHook (Mine were in use
     by MOTD)

- When the the screen is dimmed, a mouse event or key press will
     brighten the screen

- When logged in to the NeXTstep environment, the screen dimmer uses the
     time value as set in the Automatic Dimming section of
     /NextApps/Preferences

Below is the README file from doze2 that I have submitted to
sonata.cc.purdue.edu...

---------------------------------------------------------------------
Doze is a daemon that combines loginwindow and NeXTstep screensaving
for the NeXT (Tested only under version 2.1)


Usage: dim-level bright-level dim-delay bright-delay

Ranges: level(0-61) delay(0+ secs)

Sample: doze 0 61 1 30

Note: NeXTstep logins  the dimming delay is set to the Preferences Dim Setting
                       being checked at interval dim-delay
                       screensaver option available only during NeXTstep logins


The way I use doze is to call it from my /etc/rc.local:

if [ -f /usr/local/bin/doze ]; then
        /usr/local/bin/doze 0 61 30 1 && (echo -n ' doze')      >/dev/console
fi


These settings give the following characteristics:

        Doze checks every dim-delay sec(s) for the user/group ownsership of
        /dev/evs0. If it is 0/0 (root/wheel) then noone is logged in and the
        screen is dimmed to dim-level.

        (root login: ownership changed to 0/1 (root/daemon))

        Doze checks every bright-delay sec(s) for a NeXTevent. Upon receiving a
        NeXTevent, the screen brightens to bright-level.

Workspace (Logged into Workspace (NeXTstep)):

        Doze checks every dim-delay sec(s) for the Automatice Dimming to expire
        as set in /NextApps/Preferences. Upon expiration the screen is dimmed
        to dim-level.

        Doze checks every bright-delay sec(s) for a NeXTevent. Upon receiving a
        NeXTevent, the screen brightens to bright-level.


To compile:     make doze               (daemon)
                make install            (installs in /usr/local/bin)
                make clean              (removes doze)
        or:     make all                (daemon)


You have to run doze as root to have permission to dim the loginwindow.


Disclaimer:             Doze is free and you use it at your own risk.

Troubleshooting:        Dim checks for the loginwindow by the file ownership
                        of /dev/evs0. If you are in the NeXTstep environment
                        when root does a reboot (in contrast to using the
                        shutdown command), the ownership is not correct
                        until someone logs into/out of the NeXTstep environment

                        ie. if foobar is logged in at reboot, the ownership
                        will be (foobar other) instead of (root wheel).
                        Note: when root is logged into NeXTstep, the ownership
                        is (root daemon)


Credit where credit is due:

                John W.Garnett  original bright.c (evs examples)
                Ed Klein        fork and execl examples
                Mike Matthews   beta testing / suggestions for improvement

Comments/suggestions to Jeff Kight - jkight@auvm.bitnet