4 Dec 2013

Enable Numlock on bootup in GDM, LightDM and LXDM

GDM :-

First you'll have to install package 'numlockx'. It is available in the repositories of almost every Linux distribution. After you have installed 'numlockx' package open the following file as root in your favorite text editor,


/etc/gdm/Init/Default


And add the following code right above the line "exit 0" towards the end of the file,


if [ -x /etc/rc.d/rc.numlock ] && [ -x /usr/bin/numlockx ]; then
 /usr/bin/numlockx on
fi

Reboot and you'll have your Num Lock on by default at the GDM login window.

LightDM:-

Install package 'numlockx' as described earlier and open the following file as root,


/etc/lightdm/lightdm.conf

And add the following line to the file,


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

Reboot and enjoy.

LXDM:-

No need to install 'numlockx' here. Open the following file in your text editor as root,


/etc/lxdm/default.conf

And look for the line "[base]" and just add the following below it,


numlock=1

Save the file and you are done. On next boot you will have Num Lock enabled by default.

Cheers.

No comments: