PDA

View Full Version : [ubuntu] Want NumLock Key On



tb75252
May 1st, 2011, 02:20 AM
I am using Ubuntu 10.10 (32-bit).

Is there a way to turn the NumLock key on before the login screen? Right now, it only turns automatically on after the login screen...

I have NumLock enabled in my BIOS and I even have installed "numlockx". Bat that does not help.

wojox
May 1st, 2011, 03:56 AM
sudo cp /etc/gdm/Init/Default /etc/gdm/init/Default_backup

gksudo gedit /etc/gdm/Init/Default

* Find this line


exit 0

*Add the following line above it


/usr/bin/numlockx on

bug67
May 1st, 2011, 04:30 AM
This is what worked for me:

http://ubuntuforums.org/showpost.php?p=10495922&postcount=4

oklokl
May 1st, 2011, 05:21 AM
https://help.ubuntu.com/community/NumLock

sudo gedit /etc/gdm/Init/Default


# Set numlock on in GDMecho "Setting numlock on in GDM"
GDM_INIT=/etc/gdm/Init/Default
if [ -f $GDM_INIT ]; then
if ! grep -q numlockx $GDM_INIT ; then
sed -i 's/^exit 0/test -x \/usr\/bin\/numlockx \&\& \/usr\/bin\/numlockx on\nexit 0/g' $GDM_INIT
fi
fi
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi

Does not turn on numlock
Enabled

wolfen69
May 1st, 2011, 05:38 AM
You can go into most BIOS's and choose to have Numlock enabled.

tb75252
May 3rd, 2011, 02:57 AM
sudo cp /etc/gdm/Init/Default /etc/gdm/init/Default_backup
gksudo gedit /etc/gdm/Init/Default* Find this line


exit 0*Add the following line above it


/usr/bin/numlockx on


Unfortunately it does not work for me. I have numlockx installed and I copy/pasted the code as you gave it to me but NumLock still stays off before the login screen. After I am past the login screen, NumLock turns on.

Maybe it is because I have old hardware. (11-year old desktop...)

tb75252
May 3rd, 2011, 02:58 AM
This is what worked for me:

http://ubuntuforums.org/showpost.php?p=10495922&postcount=4


As I was just telling wojox, this method unfortunately does not work for me...

tb75252
May 3rd, 2011, 03:15 AM
https://help.ubuntu.com/community/NumLock

sudo gedit /etc/gdm/Init/Default


# Set numlock on in GDMecho "Setting numlock on in GDM"
GDM_INIT=/etc/gdm/Init/Default
if [ -f $GDM_INIT ]; then
if ! grep -q numlockx $GDM_INIT ; then
sed -i 's/^exit 0/test -x \/usr\/bin\/numlockx \&\& \/usr\/bin\/numlockx on\nexit 0/g' $GDM_INIT
fi
fi
if [ -x /usr/bin/numlockx ]; then
/usr/bin/numlockx on
fi
Does not turn on numlock
Enabled


Unfortunately your solution does not seem to work for me... NumLock stays off before the login screen and turns on only after I am logged in.