Here is what FINALLY worked for me I use Fedora core 3
open Emacs and type the following:
#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;
}
save as: setnumlock.c
Since this is just a source file, you will need to compile it by pasting the following into a command shell in the same directory as this file you saved as setnumlock.c:
type: gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock setnumlock.c -lX11 -lXtst
type: cp setnumlock /bin/
Edit your /home/(your-login)/.bashrc file in emacs and put in the "setnumlock" command without quotes of course..
You should now be able to just log out and back in and NUMLOCK should be on..
I hope...
zoomastr