Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



NUMLOCK IN TEXT-MODE


There are people, like myself, that absolutely want numlock enabled in every instance when the computer is booted. ( Maybe because their password has numbers ? )
In KDE and Gnome there are settings for numlock in the control, but they only kick in as soon as you start the window manager. ( for other window managers like XFCE, IceWM or Fluxbox see NumlockX )
So, imagine you want numlock enabled in text-mode ( without X ). Basically the trick is pretty simple: you need a little script that starts in runlevel 1 and every level above.
That way even when you do Ctrl+Alt+F1 or even in single user mode you will have numlock enabled.

There are two ways to achieve your goal.

1). Either add these lines at the bottom of the /etc/rc.local file:

QUOTE
for tty in /dev/tty[1-9]*; do
setleds -D +num < $tty
done

Note, the same file is called differently in several distributions:
Fedora: /etc/rc.local
Slackware: /etc/rc.d/rc.local
SUSE: /etc/init.d/boot.local
Mandriva: /etc/rc.local
PCLos: /etc/rc.local


2). Or, if your distro has no rc.local file you can place the next script in /etc/init.d:

QUOTE
#!/bin/bash
for tty in /dev/tty[1-9]*; do
setleds -D +num < $tty
done
#End script

and link it to the /etc/rc.d/<runlevels> like described in Init ( Startup Scripts )


Now, if you type your password you can be sure that the numbers match.



Bruno



-- Jan 28 2007 --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email