LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 11-22-2004, 12:06 PM   #1
LittlesnowLinux
Member
 
Registered: Nov 2004
Location: China
Distribution: Debian
Posts: 30

Rep: Reputation: 15
How can I make my debian turn NumLock on automatically?


Every time,as I start up my debian, I must turn NumLock on myself.Though it was a little job,it still bother me very much.So I want to know,how can I make my debian turn it on automatically,as it start up?And edit what file?
 
Old 11-22-2004, 01:35 PM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
If you use KDE there's a setting you can change somewhere http://www.linuxgazette.com/node/view/395 If you don't use KDE but you have a C compiler you can compile a small binary that will do the job. Copy and paste this into a text file and call it setnumlock.c
Code:
#include <X11/extensions/XTest.h>
#include <X11/keysym.h>

int main(void)
{
	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 open a terminal and

gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock setnumlock.c -lX11 -lXtst

That will create a binary called setnumlock. Copy it somewhere convenient (in your $PATH?) To run it when you log in to Gnome run gnome-session-properties and enter setnumlock in the startup programs.
 
Old 11-22-2004, 01:47 PM   #3
nedwardss
LQ Newbie
 
Registered: Apr 2004
Distribution: Debian Testing/Unstable
Posts: 12

Rep: Reputation: 0
numlockx

there is a small program in apt called numlockx that has been working for me. just install it.
 
Old 11-22-2004, 11:07 PM   #4
LittlesnowLinux
Member
 
Registered: Nov 2004
Location: China
Distribution: Debian
Posts: 30

Original Poster
Rep: Reputation: 15
Thanks very much!!
 
Old 11-25-2004, 09:31 AM   #5
LittlesnowLinux
Member
 
Registered: Nov 2004
Location: China
Distribution: Debian
Posts: 30

Original Poster
Rep: Reputation: 15
I am sorry to bother you again, nedwardss.Because the program you recommened have been installed by me,But it doesn't work.
The problem is still the same.Every time I must turn it on by hand as the same.
How can you make it work?Can you tell me?
 
Old 11-25-2004, 11:10 AM   #6
macondo
Senior Member
 
Registered: Jul 2003
Posts: 1,016

Rep: Reputation: 51
#apt-get install numlockx

afterwards a dialog pops up asking you if you want it to be activated, say 'yes' (default answer=.

OR

#dpkg-reconfigure numlockx

do as explained above.
 
Old 11-25-2004, 12:35 PM   #7
utanja
Member
 
Registered: Apr 2004
Location: Europe:Salzburg Austria USA:Orlando,Florida;
Distribution: Debian
Posts: 625

Rep: Reputation: 32
Quote:
Originally posted by macondo
#apt-get install numlockx

afterwards a dialog pops up asking you if you want it to be activated, say 'yes' (default answer=.

OR

#dpkg-reconfigure numlockx

do as explained above.

works fine for me...
 
Old 11-26-2004, 07:25 AM   #8
LittlesnowLinux
Member
 
Registered: Nov 2004
Location: China
Distribution: Debian
Posts: 30

Original Poster
Rep: Reputation: 15
Oh,I see.Perhaps the former version of numlockx I downloaded is a crashed version.So it didn't pop up the dialog.Now I have changed my source.list.So it must be no problem.(Because I haven't restart my computer)
 
Old 11-26-2004, 07:40 AM   #9
macondo
Senior Member
 
Registered: Jul 2003
Posts: 1,016

Rep: Reputation: 51
I can't remember if it exiist in Sarge, but for sure, it does in Sid.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
numlock turn on auto with start whited Linux - General 2 03-05-2005 12:53 PM
making numlock turn on at kdm startup nafan Mandriva 2 08-23-2004 01:12 PM
automatically enable numlock on startx dbkluck Linux - Software 2 06-19-2004 12:53 PM
turn on numlock (wmaker) eduac Linux - Software 1 12-01-2003 02:23 PM
how to turn numlock on automatically? Alf829 Linux - Newbie 6 08-22-2003 09:15 AM


All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration