Activating numlock on bootup

From ParabolaWiki
Jump to: navigation, search
This article or section is out of date.
Please help improve the wiki by updating the article and correcting mistakes.

1 TTY (Teletype) Consoles 1-6

To activate NumLock during normal bootup in TTY consoles 1-6 (tty1 -> tty6), add the following line to /etc/rc.local:

for tty in /dev/tty?; do /usr/bin/setleds -D +num < "$tty"; done

If strange things start to happen (the NumLock LED is on, but the num pad still works as arrow keypad), there seems to be a conflict between setleds and Xserver. Limit the for command only to the consoles you have set on /etc/inittab. For example, for the first 6 consoles (default) :

for tty in /dev/tty{1..6}; do ...


If you use startx to start your X session, simply install the numlockx package and add it to your ~/.xinitrc file.

Install numlockx:

# pacman -S numlockx

Add it to ~/.xinitrc before exec:

# ~/.xinitrc
# Executed by startx (run your window manager from here)

numlockx &

exec your_window_manager

2.1 KDM

If you use KDM as a login manager, make sure you have numlockx installed and add :

numlockx on

to your /usr/share/config/kdm/Xsetup, or to /opt/kde/share/config/kdm/Xsetup if you're using KDM3.

Note that this file lives outside of Pacman's protected area, so it might be overwritten on update without warning or creating a .pacnew file. If it bothers you, add the following line to your /etc/pacman.conf file (omit the leading slash in the path):

NoUpgrade = usr/share/config/kdm/Xsetup

2.2 KDE4 Users

Go to System Settings, under the Hardware/Input Devices/Keyboard item you will find an option to select the behavior of NumLock.

2.2.1 Alternate Method

You may alternatively add a script to your ~/.kde4/Autostart directory:

$ nano ~/.kde4/Autostart/numlockx

Add the following:

numlockx on

And make it executable:

$ chmod +x ~/.kde4/Autostart/numlockx

2.3 GDM

First make sure that you have numlockx (from extra) installed. Then, GDM users may add the following code to /etc/gdm/Init/Default:

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

2.4 SLiM

In the file /etc/slim.conf find the line:

#numlock             on

and remove the #