Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

numlock status

66 views
Skip to first unread message

Marc Williams

unread,
Nov 21, 2001, 6:50:12 PM11/21/01
to
I want my num lock automatically set to on when I log in. I'm running
Redhat 7.1 with Ximian Gnome. Here's what I've done so far which sort of
works but doesn't go far enough.

1) Installed numlockx - the default installation didn't go well but with
some editing, I got it working. Unfortunately, it doesn't lock the keypad
until AFTER I log in.

2) Added the following to my rc.local file which has the effect of turning
on my numlock status at some point during my boot up but it promptly goes
off again just prior to my login prompt appearing:

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


I gleaned both of the above from various newsgroups and mailing lists.
Does anyone know what else I can do to get my numlock status turned on
automatically AT my login prompt? Thanks!!

Sebastian Hans

unread,
Nov 22, 2001, 4:28:47 AM11/22/01
to
In article <pan.2001.11.21.17...@onlymooo.com>,

Marc Williams wrote:
>I want my num lock automatically set to on when I log in. I'm running
>Redhat 7.1 with Ximian Gnome. Here's what I've done so far which sort of
>works but doesn't go far enough.
>
>1) Installed numlockx - the default installation didn't go well but with
>some editing, I got it working. Unfortunately, it doesn't lock the keypad
>until AFTER I log in.
>
>2) Added the following to my rc.local file which has the effect of turning
>on my numlock status at some point during my boot up but it promptly goes
>off again just prior to my login prompt appearing:
>
>for tty in /dev/tty[1-9]*; do
> setleds -D +num < $tty
>done

I'm not familiar with Redhat, but maybe setleds is called in some other
script executed after rc.local turning num lock off again?

Just a guess.

seb

Yvan Loranger

unread,
Nov 22, 2001, 9:15:27 AM11/22/01
to
Marc Williams wrote:
> I want my num lock automatically set to on when I log in. I'm running
> Redhat 7.1 with Ximian Gnome. Here's what I've done so far which sort of
> works but doesn't go far enough.
>
> 1) Installed numlockx - the default installation didn't go well but with
> some editing, I got it working. Unfortunately, it doesn't lock the keypad
> until AFTER I log in.
>
> 2) Added the following to my rc.local file which has the effect of turning
> on my numlock status at some point during my boot up but it promptly goes
> off again just prior to my login prompt appearing:
>
> for tty in /dev/tty[1-9]*; do
> setleds -D +num < $tty
> done

2 actions are needed, one for console, one for X.
setleds is for console & works well.
For X, you can...


<<The below is quoted from Christopher W. Aiken>>

Method 1.
Check to see if you have a .Xmodmap file in your home
directory. If you do then add the following to the end
of the file. If you don't have the .Xmodmap file, then
create one with the following. Once this is done just
restart your X server.

keycode 79=7
keycode 80=8
keycode 81=9

keycode 83=4
keycode 84=5
keycode 85=6

keycode 86=plus
keycode 87=1
keycode 88=2
keycode 89=3

keycode 90=0
keycode 91=period


Method 2.
Look for the file ".../xkb/types/basic". This file is usually
located in /etc/X11 or in /usr/X11R6/lib/X11 Use the "locate"
command to find it. It's location is dependant on the flavor
of Linux that you are running. Once you have found this file,
use you favorite editor (as root) and look for the section of
code that looks like this:

type "KEYPAD" {
modifiers = Shift+NumLock;
map[None] = Level2;
map[Shift] = Level1;
map[NumLock] = Level1;
map[Shift+NumLock] = Level2;
level_name[Level2] = "Base";
level_name[Level1] = "Number";
};

Now change all the "Level1" to "Level2" and "Level2" to "Level1".
That is just switch them around. Once this is done, just restart
your X server.

<<The above is quoted from Christopher W. Aiken.>>
<<..hoping it wasn't too long a quote as to qualify as abusive :)>>

...however the numlock led won't light up even though the keys work! I
don't use Gnome nor your login program so your mileage may vary. Your
best bet may still be numlockx.

--
Merci...........Yvan Why don´t people understand when
I say my automobile has 100 Megametres on it?

Marc Williams

unread,
Nov 25, 2001, 8:15:45 AM11/25/01
to
Ok, I finally found the answer. I was prodded along in my quest via an
unnamed correspondent.

Not only did I place numlockx in the suggested files:
/etc/X11/xdm/Xsetup_0
/etc/X11/xinit/xinitrc

I also had to place it in:
/etc/X11/gdm/Init/Default

It's quite possible that numlockx in the first two are redundant. I
haven't checked because I think it's harmless to leave them in there. But
the change to /etc/X11/gdm/Init/Default is absolutely required in order to
get my numlock led to light and my keypad functioning correctly AT MY
GNOME LOGIN PROMPT.

It shouldn't have been this difficult.

0 new messages