Monday, October 6, 2008

Fedora 9 - setting NumLock on automatically

One thing that was bugging me about Fedora 9 was that it didn't have the NumLock key turned on by default. It wasn't annoying enough that I wanted to change distros' (openSuSe has this feature on by default) but it annoyed me enough that I went looking for it.

I was quite disappointed to find that there were a lot of elitist and jerkish behaviour in the replies by a lot of people that are supposed to be helping new people in the Fedora forums. No wonder MS continues to have such a strong market share.

Anyway, I did finally find how to do it, so I figured that if someone else wanted to make Fedora 9 have the NumLock key on from startup or by default, then here is how to do it:

First go into super user mode : su

then:

yum install numlockx

then :

gedit /etc/gdm/Init/Default

next you search for a line like this:

exit 0

In my case, it was at the end of the file. Now you add this code on top of that line:

if [ -x /usr/bin/numlockx ]; then /usr/bin/numlockx on fi

So you end up with something like this:

if [ -x /usr/bin/numlockx ];
then /usr/bin/numlockx on
fi

exit 0


Don't forget to save and then exit. Next time you boot up the computer, the NumLock key should be on by default. It worked straight away for me, hopefully it'll work for you as well.

2 comments:

Olivier said...

Installing numlockx with yum should "work out of the box", because the package installs a small shell script:

/etc/X11/xinit/xinitrc.d/numlockx.sh

which automatically starts when you boot X.

Anonymous said...

Thank you, Dr. Neo Lao. A terrific help! -- Woodstock, Connecticut