LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-13-2005, 09:33 PM   #1
ToothlessRebel
Member
 
Registered: Jun 2004
Location: FL, USA
Distribution: Slackware 9.1
Posts: 190

Rep: Reputation: 30
Setting num lock to "on" at boot or log in.


Is there a way to mae it so that num lock isn't reset to off everytime the computer boots?
Using Slackware 9.1, KDE/KDM
 
Old 06-13-2005, 09:54 PM   #2
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 46
i've been using linux for a couple years, and i've never been able to get a gui to launch with numlock on. it's such a simple thing, you'd think someone would have an easy solution. but nothing i've tried has ever worked. search google and try the various methods, maybe you'll have better luck.
 
Old 06-13-2005, 10:46 PM   #3
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid
Posts: 4,733
Blog Entries: 12

Rep: Reputation: 456Reputation: 456Reputation: 456Reputation: 456Reputation: 456
In debian there is a small app called numlockx, that does just that. Turns the numlock on at login/boot.

If you are running KDE, you can open the Control Center>Peripherals>Keyboard>NumLock on KDE Startup and choose Turn on.
 
Old 06-13-2005, 11:31 PM   #4
mdg
Member
 
Registered: Sep 2003
Distribution: Slackware
Posts: 626

Rep: Reputation: 37
This is what works for me in Slack 10:

Code:
# This turns on numlock:
for tty in /dev/tty[1-6]; do
/usr/bin/setleds -D +num < $tty
done
Put it in the /etc/rc.d/rc.local file. Make sure rc.local is executable
 
Old 06-14-2005, 03:00 AM   #5
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 46
install numlockx and make sure it runs at startup

and here is a detailed howto

http://startlinux.co.nz/articles/article_139.php

Last edited by heema; 06-14-2005 at 03:04 AM.
 
Old 06-14-2005, 06:19 AM   #6
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
I have, in my ~/.xinitrc numlockx starting before my window manager - this does the job fine...
 
Old 06-14-2005, 09:34 AM   #7
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 46
numlockx doesn't work for me, either. maybe it's because i'm using xfce4 and it's not going through startx but startxfce4? after it didn't work in ~/.xinitrc, i put it in both ~/.xfce4/xinitrc and in the global xfce4 xinitrc, but still no numlock. it flashes for second while X is starting, then it turns off again, but it does that normally anyway. i've resigned myself to the fact that i'm just never going to have default numlock in linux.
 
Old 06-14-2005, 09:40 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,925

Rep: Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327Reputation: 1327
numlockx didn't work for me either, so I found the following c program:
Code:
#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;
}
Compile it like this:
Code:
gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock setnumlock.c -lX11 -lXtst
and add the line:
Code:
/usr/X11R6/bin/setnumlock &
before invoking your wm.

Regards
 
Old 05-30-2006, 11:46 AM   #9
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 60
An old reply to this often asked question by user: dracae (Hmmm. Haven't seen him lately.) Works great in Debian.
Quote:
install console-tools if not already, add
LEDS=+num
to /etc/console-tools/config
Edit: Oops I posted to this thread by accident. Guess I'll leave it. Might help somebody.

Last edited by rickh; 05-30-2006 at 11:49 AM.
 
  


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
New SQUID user: How to clear the "access.log" and "store.log" automatically? yuzuohong Linux - Networking 2 12-02-2006 05:37 AM
KDE "Logout" and "Lock Session" menu restoration powah Linux - Software 3 03-29-2005 08:02 PM
KDE "Lock Session" and "Logout" menu restoration tcma Linux - Software 0 01-29-2005 11:12 AM
CAPS LOCK strangeness -- "a" turns into "S" nschoena Linux - Software 6 06-04-2004 10:45 AM
Boot messages not the same as "dmesg" or "/var/log/messages"? massai Linux - General 5 03-10-2004 12:18 AM


All times are GMT -5. The time now is 12:06 PM.

Main Menu
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