R. Brock Lynn wrote:

> > > i want to make a text-based screensaver that has a block that moves
> > > around the screen (saw it once on some ancient netware server), i could
> > > write the program, but how would i make it run instead of the builtin
> > > screen blanker?
> > 
> > I suspect that you'll need to modify the kernel; there doesn't seem to
> > be any simple way to determine when the screen saver should be
> > activated.
> 
> Not that this is directed at you personally Glynn, but rather it's directed at
> your idea: THAT'S BULLSHIT MAN, BULL SHIT!!!
> 
> I can't code not one good line of C code, but I do know that it's possible to
> write a console VT program that monitors keystrokes or gpm movement and clicks,
> (by hooking into the stdin stream) and that can count down a specified time and
> then start up a color ncurses screen saver, and maybe even an svgalib
> screensaver!

Will this deal with console switching? Will it interfere with whatever
program happens to be running on the VC at the time?

Reading stdin is of no use, as that will interfere with whatever
program you're trying to run. It may well be possible to monitor the
mouse without interfering with other programs, but I don't know of any
way to do this for the keyboard.

> I mean, WHY would you have to modify the KERNEL, just to implement a
> screensaver?

I'm not talking about adding the screensaver itself to the kernel. I'm
talking about finding out when the screensaver should be run.

Having examined the kernel's screen blanking code, I was unable to
find anything that would allow a user space program to find out when
the keyboard/mouse were idle.

It's possible that there is some method that I overlooked. However,
it's also possible that this information simply isn't available from
user space.

> I don't get it. If you can convince me that screensaver hooks must
> be explicitly written into the kernel, then you are basically saying that the
> current state of the Linux kernel is substandard, and of bad design, because it
> doesn't support something so basic...

I'm not saying it's bad design. I'm just saying that there doesn't
seem to be such a feature currently implemented.

> But I know, it can be done without messing with the kernel. That is a user-space
> app, and it is not good to just randomly slap user-space code into the kernel...
> we all *know* where that'll get ya 8^)
> 
> Well, there's got to be a way to hook into the stdin, and then do a countdown...
> but if not, there *DOES* at least need to be a generalized method of input
> monitoring so that all user-level apps can rely on it for such things as
> screensavers, etc. Maybe, if it does not already exist, make a device file that
> all it does is, when read, report the amount of time that has elapsed since the
> last input event. And there could be different times served by this one device
> file, you send it certain integers, and it reports on either the system as a
> whole, or, just the keyboard, or just the mouse, or even just the "k" key, or
> just the middle mouse button, or the upper-left button on the joystick. (or even
> input from the mic) Simplicity and generality always lead to the best designs...

The simplest solution that I can think of is to replace the bodies of
the do_[un]blank_screen functions with printk() calls, and then
monitor the syslog output from user space.

-- 
Glynn Clements <[EMAIL PROTECTED]>

Reply via email to