I’ve written a tutorial about enable numlock lamp on Ubuntu login screen. It’s convenient when typing numbers while at login. This tutorial will show you how to enable numlock lamp at Ubuntu 12.04 LightDM login screen.

Enable Numlock on Login:

First open terminal from the dash home or press Ctrl+Alt+T, install numlockx:

sudo apt-get install numlockx

Then edit /etc/lightdm/lightdm.conf via this command:

sudo gedit /etc/lightdm/lightdm.conf

Add this to the end of file and save it! It will work after reboot!

greeter-setup-script=/usr/bin/numlockx on

If you changed display manager to GDM, KDM, see this post

(following via help.ubuntu.com)

Enable NumLock from startx:

If you are not using a graphical display manager then add the following line to /etc/X11/xinit/xinitrc:

/usr/bin/numlockx on

Enable NumLock for Virtual Consoles (TTYs):

If you use the virtual consoles regularly, then you will quite likely want to have numlock on for the TTYs after boot up. The status of numlock/scroll-lock/capslock can be manipulated with the setleds command. One way to guarantee that numlock will be turned on after bootup for the TTYs is to run setleds via rc.local (a script run after every runlevel change; which in particular runs after booting up). To do so add something similar to the following in the file /etc/rc.local:

# Turn Numlock on for the TTYs:
for tty in /dev/tty[1-6]; do
/usr/bin/setleds -D +num < $tty