Difference between revisions of "Activating Numlock on Bootup"

From ArchWiki
Jump to navigation Jump to search
Line 11: Line 11:
 
{{i18n_links_end}}
 
{{i18n_links_end}}
  
== Virtual Consoles 1-6 ==
+
== TTY (Teletype) Consoles 1-6 ==
  
To activate the numlock during normal bootup in virtual consoles 1-6 (vc/n), add the following line to <code>/etc/rc.local</code>:
+
To activate the numlock during normal bootup in TTY consoles 1-6 (tty1 -> tty6), add the following line to <code>/etc/rc.local</code>:
  for vc in /dev/vc/*; do /usr/bin/setleds -D +num < "$vc"; done
+
  for tty in /dev/tty*; do /usr/bin/setleds -D +num < "$tty"; done
 +
 
 +
note: Virtual Consoles vc/1 -> vc/6 were superseded by tty1 -> tty6 on the 2009-08-02.
  
 
== X.org ==
 
== X.org ==

Revision as of 12:40, 4 August 2009


Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n entry Template:I18n links end

TTY (Teletype) Consoles 1-6

To activate the 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

note: Virtual Consoles vc/1 -> vc/6 were superseded by tty1 -> tty6 on the 2009-08-02.

X.org

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:

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

numlockx &

exec your_window_manager

KDM

If you use KDM as a login manager, add :

numlockx on

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

KDE Users

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

$ nano ~/.kde/Autostart/numlockx

Add the following:

#!/bin/sh
numlockx on

And make it executable:

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

Note: There is an option in kcontrol (for kde3) and systemsettings (for kde4) to activate numlock at kde start. but it is currently broken because noone dare to fix something that someone broke (it was working one day ..)

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
fi

SLiM

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

#numlock             on

and remove the "#"