How To: Enable NumLock On Login Screen by Default

Are you getting frustrated each time you log-in into your desktop, just because you need to press the NumLock key every-time that you type your password?

Updated Mar 25, 2015How To's
Numlock Numeric Keypad

Upon booting our computers into our daily used desktop environments, it’s not unusual to encounter a login screen which prompts us to type a password.

Often, this password can be consisted of some numbers, whether partly or entirely, and for users who are used to use the numeric keypad it may be a bit frustrating to press the NumLock button each time you login.

Thus, following is a short tutorial which will show you how to make your login screen (display manager) load with NumLock enabled by default.

Enable NumLock By Default

In order to turn NumLock on by default each time you boot and reach the login screen, you first need to find out which display manager is your distro using. (if you don’t know it already)

To help you find out just that, here’s a short list of most common display managers being used by most distros:

List of common Display Managers

  • GDM (GNOME Display Manager)
  • KDM (KDE Display Manager )
  • LightDM (a Lightweight Display Manager, mostly used by Ubuntu – Unity, and derivatives)
  • SDDM (Simple Desktop Display Manager, successor of KDM for KDE Plasma 5)

You may look whether your distro uses one of the above online, or, you may also run a search inside your distro’s package manager to see whether one of these is installed on it or not.

Note: if in doubt, I recommend you do both.

Next, we’ll need to install a package named numlockx – the tool which is essentially in charge of enabling NumLock on / off for us. Look for the package inside your distro’s PM.

The last step is to tell (configure) the display manager to use numlockx and turn Numlock button on each time the DM loads.

The way you do so depends on which DM you are using, so use the following according to your needs:

GDM

Add the following code to /etc/gdm/Init/Default:

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

KDM

Add the following to the file /usr/share/config/kdm/Xsetup:

numlockx on

LightDM

add the following line to /etc/lightdm/lightdm.conf:

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

SDDM

Add the following line under the [General] section inside the file /etc/sddm.conf:

[General]
Numlock=on

 

Note: these files may be overwritten upon update, hence don’t forget to re-edit them as well in case needed.

COMMENTS (beta 4)

?
Add your comment here...

More In Linux