LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   numlock @ boot (https://www.linuxquestions.org/questions/linux-newbie-8/numlock-%40-boot-310391/)

nadroj 04-06-2005 11:21 AM

numlock @ boot
 
how can i get numlock to turn on automatically after bootup?
i know theres a setting for this in bios and i have it on and it works when i boot windowz, but is off when i boot into linux.

its just all these little things that i take for granted in windows that keeps me discouraged from linux.

i wouldnt think it should matter, but im running ubuntu 5.04 on 2.6.10.5

thanks

eeried 04-06-2005 11:23 AM

If i remember right people have said somewhere (not on this forum though) you can get aprogram called xnumlock through apt-get and it should do the job (or help you configure your numlock option).

nadroj 04-06-2005 11:27 AM

alright, thanks..

ill check out the program with synaptic and try to install it.
do you know much about it? it seems it would make sense it would just load at boottime and then end after this? so it doesnt stay in memory for no reason..

i would have thought there would be a file you could edit and add a line for this :S oh well, maybe not.

thanks again!

phil.d.g 04-06-2005 01:24 PM

if just using X then you need to use numlockx or similar app, I use it without problems, if just booting to a console then you can use the setleds program which seems to be normally included in dirstros, it certainly is in slackware anyway

eeried 04-06-2005 01:33 PM

i'm afraid I don't know anything about the program xnumlock but you'll find some information in Synaptic.

I would imagines it configures the right file for you, and there ought be a way to edit a file manually -- but then we both must cry for help or search the Web at this stage because I have not the faintest idea -- I've grown used to pressing the numlock key, and checkinng it's on has become a habit. True though ,auto-numlocking would be good.

Boow 04-06-2005 03:07 PM

Copy the following into setnumlock.c
#include <X11/extensions/XTest.h>
#include <X11//keysym.h>

int main(){
Display* disp = XOpenDisplay(NULL);
if (disp == NULL) return 1;
XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock),
True, CurrentTime);
XTestFakeKeyEvent(disp, XKeysymToKeycode(disp, XK_Num_Lock),
False, CurrentTime);
XCloseDisplay(disp);
return 0;
}
Then compile it with:
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock setnumlock.c -lX11 -lXtst

Then place it in your /etc/xinit/xinitrc file (or the file that symlink is pointing to) as the second to last line.

NOTE: KDE3.1 has a configurable option to enable/disable numlock in Control Center/Peripherals/Keyboard.

copied from webpage author unkown.


All times are GMT -5. The time now is 08:10 PM.