Enable Numlock on Login

System Settings > Keyboard Layout > Options > Miscellaneous compatibility options

Check "Default numeric keypad keys"

This setting takes effect after Login and has no effect at the Login screen or consoles.

numberlockenable.png

Enable NumLock during startup

Enabling Numlock on startup can be done of several different ways. First install numlockx:

sudo apt-get install numlockx

Place command with init scripts

sudo sed -i 's|^exit 0.*$|# Numlock enable\n[ -x /usr/bin/numlockx ] \&\& numlockx on\n\nexit 0|' /etc/rc.local

Enabling 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

Enabling NumLock from lightdm configuration

In Ubuntu 14.04 the above methods of running numlockx don't work. It can be run by changing configuration of LightDM display manager. Edit /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf file and add the following line at the end:

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

This defines running numlockx command when starting the Unity Greeter. (See more info in /usr/share/doc/lightdm/lightdm.conf.gz).

Enabling 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
done

Enable NumLock in KDE

From the K Menu, launch System Settings and click on Keyboard (Edgy users: K Menu -> System Settings -> Keyboard and Mouse -> Keyboard). You can see in the middle section the options for "NumLock on KDE Startup", where you can choose to Turn On, Turn Off, or Leave Unchanged. Select "Turn On" to turn NumLock on at startup.

Enable NumLock in Lubuntu

Enter Preferences -> LXQt Settings -> Keyboard and Mouse, and selecting the "Keyboard" tab will let you see a "Turn on NumLock after login" checkbox that you need to click. Refer to the Lubuntu manual for more details.

NumLock (last edited 2021-07-09 05:59:36 by guiverc)