The NEXTSTEP/OpenStep FAQ

! to the table of contents
< to the previous section:
> to the next section:


4.9 Manipulating the Loginwindow

loginwindow dwrites

There are some for loginwindow:

[Jess Anderson writes:]

Here, I hope, is the quasi-definitive story on dwrites that affect the loginwindow. I'm indebted to several people, notably Art Isbell, Kristian Koehntopp, Dan Danz, Louie Mamakos, John Kheit, Felix Lugo, and Paul Sears, for some of the information presented here.

Remember that dwrites are not supported by NeXT; they may change with any subsequent system release. These I've checked out using 3.0; some or all may work with earlier releases, but I can't vouch for most of them.

All these dwrites must be done as root. You can also run as root and use DefaultMgr to set them (which is a whole lot more convenient if you're intending to fiddle with some of them).

After setting the things you want, restart the WindowServer by logging out of the current session and typing exit on the login panel.

OK, here's what we know (or think we do :-):

dwrite loginwindow DefaultUser

Most new machines have set to me. This dwrite logs in user automatically. User must not have a password set, hence don't use this in a networked environment!

dwrite loginwindow HostName "" dwrite loginwindow HostName localhost These cause your host name to appear on the login panel. You need quote marks only if there's a space in the name. The first form hard-codes the name into root's defaults database. The second form uses whatever name has been set as localhost in NetInfo, which is convenient for networked machines.

The font, size, color, and position of the printed string are not accessible (drat!).

dwrite loginwindow ImageFile

This uses the tiff image pointed to instead of the standard one (in /usr/lib/NextStep/loginwindow.app/English.lproj/nextlogin.tiff, .lproj as appropriate for your main language) as the login panel. Be sure you get the pointer right, though, or you'll have to boot single-user to fix it. In practical terms, the image is constrained in various ways I won't detail here.

dwrite loginwindow TimeToDim

No relation to the dim time set by Preferences. The units are odd, I think. Felix reported them as 1/34 second. However, when I changed it to 1020, I got 15 seconds to dimming, and 680 gives 10 seconds, that I'm sure of. So I think the units are 1/68 second. Maybe Felix just thought it was too damn long! We all know it seems longer when you're not having fun waiting. :-) Whatever, the login screen dims to about half after this length of time.

dwrite loginwindow MoveWhenIdle YES

This causes the panel to move around approximately in Backspace bouncing-off-the-walls-tiff fashion. The point is to avoid burning the screen phosphors, as a static image would tend to do. The animation is controlled by the next couple dwrites.

dwrite loginwindow MovementTimeout

The units are seconds. The panel starts moving (assuming the preceding is set to YES) after this time. If you set it to be less than the TimeToDim time, the movement starts before the dimming occurs. I did not try zero. I can't stand waiting around for things to happen, so I use 10 seconds for both times. The default appears to be 5 minutes.

dwrite loginwindow MovementScale

No movement occurs if this is set to 1. But it looks like the units might be approximately pixels for each change of position (the frequency of which is controlled by the next dwrite). If you put a big number here, say 200, the image moves in big jumps, but I don't know if the 200 is divided up somehow between change in x- and y-coordinates. I wouldn't worry about it much, just set it to something you like. Since my image contains readable text, I want it to scroll smoothly around, so I use the apparently minimum value, 2. The default appears to be 10.

dwrite loginwindow MovementRate

The units are seconds. The image jumps by the amount above every this many seconds. The default is 0.0666 seconds. Bigger numbers mean slower motion. Since I don't like things being too jumpy or zooming around, I set this to 0.1 seconds. This makes my image ooze at a pace befitting an elderly person like me.

dwrite loginwindow PowerOffDisabled YES

This makes it a little harder to turn the machine off; you have to use the monitor or the minimonitor (- ) if it's set, rather than the key.

dwrite loginwindow LoginHook dwrite loginwindow LogoutHook

Pointers to the login and logout hooks, if used. It should be pointed out that some of these things (login/logout hooks, for example) are maybe more logically set where the loginwindow is invoked by the WindowServer, namely /etc/ttys.

There are yet others. Here's the full list (thanks, Art):

NXGetDefaultValue("loginwindow", "DebugHook") => 0x0 NXGetDefaultValue("loginwindow", "DryRun") => 0x0 NXGetDefaultValue("loginwindow", "WindowServerTimeout") => 0x0 NXRegisterDefaults("loginwindow", 0x16024) KeyMapPath: 0x12d97 "~/Library/Keyboards:/LocalLibrary/Keyboards:/NextLibrary/Keyboards" Keymap: 0x12de1 "/NextLibrary/Keyboards/USA" SwappedKeymap: 0x12e0a "No" LoginHook: 0x0 LogoutHook: 0x0 HostName: 0x0 ImageFile: 0x0 DefaultUser: 0x12e41 "me" PowerOffDisabled: 0x0 TimeToDim: 0x12e69 "2040" MoveWhenIdle: 0x12e0a "No" MovementTimeout: 0x12e8b "300.0" MovementRate: 0x12e9e "0.06666" MovementScale: 0x12eb4 "10"

[Christopher J. Kane [email protected]]

Under NeXTSTEP 3.1, the login window has two buttons labeled "Reboot" and "Power" that allow a user to reboot and power down from the login window. In a public lab, this feature may be undesirable. The PowerOffDisabled default can be used to disable the buttons, but they are still shown in the window and push in when clicked (a bad user interface decision, IMHO).

The program below patches loginwindow to eradicate the restart and power buttons. It makes the loginwindow's LoginButton class instance method initWithImage:altImage:andString: a no-op (just return nil). This patch has been applied to the machines in the NeXT lab at Purdue (like sonata.cc.purdue.edu for instance), and no adverse effects have been noted.

This program must be run as root, since it writes to the file /usr/lib/NextStep/loginwindow.app/loginwindow.

An archive with a compiled executable has been submitted to sonata.cc.purdue.edu.

/* * Patches the loginwindow.app to eradicate the restart and power * buttons from the login window. * * Christopher J. Kane ([email protected]) * Released into public domain; August 13, 1993. */ #include #include void main(int argc, char *argv[]) { unsigned char patch[8] = {0x0, 0x0, 0x42, 0x80, 0x4e, 0x5e, 0x4e, 0x75}; int file = open("/usr/lib/NextStep/loginwindow.app/loginwindow", O_WRONLY); if (-1==file) goto error; if (-1==lseek(file, 21170, SEEK_SET)) goto error; if (-1==write(file, patch, 8)) goto error; if (-1==close(file)) goto error; exit(0); error: fprintf(stderr, "%s: %s\n", argv[0], strerror(errno)); exit(1); }

FAQ-Authors note: We strongly recommend to do a backup of the loginwindow application, because the patch alters the file directly and will most likely not work on different versions of the OS.



This document was converted from LaTeX using Karl Ewald's latex2html.