Numlock ON when starting X

Geert Janssens geert.janssens3 at pandora.be
Wed Dec 22 07:46:12 MST 2004


I have tried both suggestions mentioned below:
1. setleds in rc.local
2. Numlock preference in KDE

1. results in all virtual terminals having Numlock set on by default.
2. results in KDE having numlock enabled once inside KDE.


But there is the step inbetween that I can't get arranged:
The graphical login screen still has Numlock disabled. Once logged in, 
I'm in KDE, so numlock is enabled.

And I have a similar problem when I start X manually for a remote X 
session. Inside this manually started X, Numlock is disabled by default.

Is there a way I can tell X (for example via the XF86Config file) to 
enable Numlock by default ?

Thank you,

Geert Jan

Andrew wrote:
> On Tue, 2004-11-30 at 20:49, Longman, Bill wrote:
> 
>>>This is probably more a generic linux question.
>>>
>>>When my system boots, neither in the virtual consoles, nor in X the 
>>>numlock key is activated.
>>>
>>>I would like to change this, such that the numlock is by 
>>>default on in 
>>>the virtual consoles and X (including the graphical login 
>>>screen kdm/gdm ?)
>>>
>>>Does anyone know where to change this ?
>>
>>Geert, my Gentoo box has a numlock init script. It calls "setleds". The
>>"setleds" man page also references "loadkeys". You might be able to find
>>something along these lines.
> 
> 
> These are good pointers!
> 
> setleds:
> 
>>From the manual:
> *****************************
> DESCRIPTION
>        Setleds  reports and changes the led flag settings of a VT
>  (namely Num-Lock, CapsLock and ScrollLock).  Without arguments, setleds
>  prints  the current  settings.   With  arguments,  it  sets or clears
>  the indicated flags (and leaves the others unchanged). The settings
>  before and  after the change are reported if the -v flag is given.
> 
> <<<SNIP>>>
> 
> One  might  use  setleds  in  /etc/rc to define the initial and default 
> state of NumLock, e.g. by
> 
>             INITTY=/dev/tty[1-8]
>             for tty in $INITTY; do
>                  setleds -D +num < $tty
>             done
> 
> *****************************
> I guess the second paragraph mean to put these line somewhere in
> /etc/rc*. I guess </etc/rc.d/rc.sysinit> or <etc/rc.d/rc.local> is the
> appropriate place(?). This one only work within virtual terminals (VTx)
> 
> 
> 
> 
> loadkeys:
> 
>>From the manual:
> *****************************
> DESCRIPTION
>        The program loadkeys reads the file or files specified by 
> filename.... Its main purpose is to load the kernel keymap for the
> console.
> 
> <<<SNIP>>>
> 
> FILES
>        /lib/kbd/keymaps
>               default directory for keymaps
> 
>        /usr/src/linux/drivers/char/defkeymap.map
>               default kernel keymap
> ******************************
> I would put my money on setleds's way...
> Further investigations (read: googleing) lead me to this:
> 
> http://www.gentoo.org/doc/en/faq.xml#numlock
> http://linux.editme.com/how-to-get-num-lock-to-default-to-on
> ..but this page beat them all fare&square:
> http://www.linuxgazette.com/node/395
> 
> As I am writing this, I notice the LED is OFF but the keypad do print
> numbers but when the LED is ON the keypad act like arrows....Weirdo!
> 
> 
>>_______________________________________________
>>yellowdog-general mailing list
>>yellowdog-general at lists.terrasoftsolutions.com
>>http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
>>HINT: to Google archives, try  '<keywords> site:terrasoftsolutions.com'
> 
> 
> _______________________________________________
> yellowdog-general mailing list
> yellowdog-general at lists.terrasoftsolutions.com
> http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
> HINT: to Google archives, try  '<keywords> site:terrasoftsolutions.com'
> 
> 


More information about the yellowdog-general mailing list