Turning on NUM LOCK automatically at startup
This is super newb question, and not really of the utmost importance, but it is kind of annoying and maybe someone knows this, how do u set it so NUMLOCK is always on when u startup? BIOS takes care of that for windows but it doesnt seem to affect RH8.
aha i have figured it out: Turn on NumLock automatically Add the following lines to /etc/rc.d/rc.local: echo -n "Turning on numlock ... " for tty in /dev/tty[1-6] /dev/tty1[2]; do setleds -D +num < $tty & done echo "done " |
bah this shit doesnt work...anyone see what is wrong with dat script?
|
Assuming you boot into X, you don't actually use /dev/tty[1-6]. Also, I don't think you need that second argument. basically:
echo -n "Turning on numlock ... " for tty in /dev/tty[1-8]; do setleds -D +num < $tty done echo "done " I don't think you have to necessarily make it go in the background wither (ie. no '&'). I coud be wrong... |
heh, now it turns on numlock at startup, but once i log on it goes off. LOL
is there a script that runs after login that i could stick that code into? |
you could try using an ~/.xsession
something like: setleds -D +num& exec openbox #assuming you run openbox. i think kde's executable is startkde, but I'm not sure. you can check that. then when your X is started, either by 'startx' or by logging in, it will parse that file, run setleds (dont forget the &), and then start kde, or whatever. |
**********FIGURED IT OUT***********************
|
Quote:
2. what was the problem? (maybe someone will come by this thread...) |
I was just about to post this when i saw that the problem was solved, but if people are curious, here's the way that I do it:
create a source file with this: Code:
#include <X11/extensions/XTest.h> gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock setnumlock.c -lX11 -lXtst Then run 'setnumlock' from the xinitrc file. |
|
Mandrake users--Mandrake 8.0 or 8.2 (or both?) offered a way to configure startup with NUMLOCK turned on, in one of the checkbox-type things you could work with. I've been unable to locate it in Mandrake 9.0 so far!
Seems like a fairly common thing for people to want, and I wish the default were NUMLOCK on. I can set NUMLOCK on in my machine's BIOS, but it gets changed again to "off" by Linux.... |
PTBmilo,
Thanks for posting the code for the num lock utility. It works great! |
All times are GMT -5. The time now is 04:13 AM. |