On Sun, 28 Nov 1999, Christian J van den Bosch wrote:
> anybody know how to get numlock to default to on in all vconsoles as
> well as in X? I hate having to turn it on for each one individually
> (yep, I am a _very_ lazy git)
You want a program called setleds. It should be run during your
system boot so add some appropriate calls in one of the boot files
in /etc/rc.d
If you use SuSE (v6+ but maybe earlier) Yast allows you to set a
couple of variables that do this for you; set them by changing the
config file.
#---<start boot.setup fragment>---------------------------
#! /bin/sh
#
# setleds
if test "$KBD_NUMLOCK" = "yes"; then
LEDOPT="+num"
else
LEDOPT="-num"
fi
if test "$KBD_CAPSLOCK" = "yes"; then
LEDOPT="$LEDOPT +caps"
else
LEDOPT="$LEDOPT -caps"
fi
if test -n "$KBD_NUMLOCK" -a -n "$KBD_CAPSLOCK" -a \
-x /usr/bin/setleds ; then
cd /dev || exit 1
if test -z "$KBD_TTY"; then
KBD_TTY="tty[1-9]*"
fi
for tty in $KBD_TTY; do
/usr/bin/setleds -D $LEDOPT < $tty
done
fi
#---<end fragment>----------------------------------------
This fragment uses a few env variables loaded as the system boots; these are
KBD_NUMLOCK turn numlock on or off
KBD_CAPSLOCK turn capslock on or off
KBD_TTY ttys the above two should be applied to
an alternative would be to call setleds directly with
setleds -D +num < tty01
setleds -D +num < tty02
or better still use the fragment in the setleds man page.
This will not apply to X sessions started through xdm or similar
(setleds only works on vconsoles). possibly there is an Xresource
which can be set
Andy Ferguson
~~~~~~~~~~~~~
Sysop MOIL BBS +44-1247-273357
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!