I use my
keyboard leds for three things:
num lock flashes when someone sends me an
aim message,
caps lock flashes when someone says something on
irc with my name in it, and
scroll lock lights up when I have new mail.
It's quite easy changing the state of your leds if you're using
linux. here is a
perl example that works both in
console and
X:
#!/usr/bin/perl
open(FH, "/dev/tty1") or die "open";
ioctl(FH, 0x4b32, 1); # scroll lock on
ioctl(FH, 0x4b32, 2); # num lock on
ioctl(FH, 0x4b32, 4); # caps lock on
ioctl(FH, 0x4b32, 0); # all off
close(FH);
Remember to put some kind of
sleep statement there if you want to see anything. Because this script calls
ioctl(), it does have to be run as
root.
This is a blinking script I use when my attention is needed:
#!/usr/bin/perl
use Time::HiRes qw( usleep );
open(FH, "/dev/tty1") or die "open";
ioctl(FH, 0x4b32, 0); # all off
while (1) {
ioctl(FH, 0x4b32, 2); usleep (50000);
ioctl(FH, 0x4b32, 0); usleep (50000);
$counter++; if ($counter == "10") { close(FH); exit; };
}
Other examples:
ioctl(FH, 0x4b32, 3); # scroll lock and numlock
ioctl(FH, 0x4b32, 6); # caps lock and numlock
ioctl(FH, 0x4b32, 5); # scroll lock and caps lock
ioctl(FH, 0x4b32, 7); # everything
Have fun!