Fedora Linux Support Community & Resources Center
  #1  
Old 31st January 2004, 05:44 PM
vorte[x] Offline
Registered User
 
Join Date: Mar 2004
Posts: 155
FAQ: Enabling 'NumLock' upon Boot/Entering X

Throw into rc.sysinit
[code:1]
for tty in /dev/tty[1-9]*; do
setleds -D +num < $tty
done
[/code:1]

Then for X, try putting this in .xinitrc
[code:1]
xset led 1
[/code:1]
  #2  
Old 2nd February 2004, 06:56 AM
redhat71 Offline
Registered User
 
Join Date: Feb 2004
Location: China
Posts: 124
only "xset led 3" works for me, but it's not numlock, any idea?
  #3  
Old 2nd February 2004, 07:00 PM
vorte[x] Offline
Registered User
 
Join Date: Mar 2004
Posts: 155
Quote:
Originally Posted by Redhat71
only "xset led 3" works for me, but it's not numlock, any idea?
I ran into that as well on my laptop, hence the reason I said 'try' I'm not sure if xset is working properly on ANY hardware configuration! I'll let you know if I find something better.
  #4  
Old 7th February 2004, 05:08 PM
Linz Offline
Registered User
 
Join Date: Feb 2004
Posts: 13
Found this on http://phuzz.org/archive.php?name=linux:
Quote:
To enable NumLock in the console paste this code into rc.local or make a script for to put into /etc/init.d/:
[code:1]echo "Enabling NumLock..."
for tty in /dev/tty{1,2,3,4,5,6,7,8,9,10,11,12}; do
setleds -D +num < $tty
done[/code:1]

X windows is nice enough to turn this off again... so paste the following code into a file named xsetnumlock.c:
[code:1]#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;
}[/code:1]

Run this command to compile it:
[code:1]$ gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o xsetnumlock xsetnumlock.c -lX11 -lXtst[/code:1]

Run xsetnumlock from ~/.Xclients (or any of its alternatives: .xsession, .xinitrc or whatever...)
Haven't restarted yet, but running the compiled xsetnumlock turns numlock on/off.
  #5  
Old 7th February 2004, 08:53 PM
vorte[x] Offline
Registered User
 
Join Date: Mar 2004
Posts: 155
Excellent tip, I'll be sure to try it.
  #6  
Old 18th June 2004, 08:29 AM
amazoneveryday's Avatar
amazoneveryday Offline
Registered User
 
Join Date: Jun 2004
Location: USA
Posts: 41
great

it works pefectly, thank you. I put the executable in my ~/.kde/Autostart folder since I'm the only user on my box.
__________________
Try it again with extensions disabled. (Hold down shift during boot)
  #7  
Old 18th June 2004, 08:33 AM
mpsii Offline
Registered User
 
Join Date: Feb 2004
Location: Winter Garden, FL USA
Age: 37
Posts: 14
Is there not a numlock rpm? Or can someone make one for Fedora?

mandrake rpm
__________________
----Michael
  #8  
Old 18th June 2004, 06:36 PM
ewdi's Avatar
ewdi Offline
Retired Admin
 
Join Date: Jan 2004
Location: Penguin Land
Age: 63
Posts: 1,939
i think there is under contrib, let me search around for it
__________________
+ Visit My new blog
- [B]SlashGear US, SlashGear Japan, and
+Founder & Admin of www.fedoraforum.org

Follow me at http://twitter.com/ewdi

Laptop : MacBook Pro 2.4Ghz 4GB DDR, 20-inch iMac Aluminium/4GB RAM
  #9  
Old 22nd June 2004, 10:06 AM
RuiP's Avatar
RuiP Offline
Registered User
 
Join Date: Apr 2004
Location: Lisboa-Portugal
Posts: 19
I never find a numlockx for fedora and mandrakes version fails (of course) due to dependencies not satisfied... (maybe this one?... in case of despair )
but thereis a good how-to here and a link to tar.gz here.

I solved the beginnig-at-X problem with a muuuch easier way... I just run gnome-session-properties and at 'Startup Programs' Add a new entry, a simple 'numlockx' (I have to do it for all users... only two) works great!
  #10  
Old 26th June 2010, 04:13 AM
april Offline
Banned
 
Join Date: Dec 2009
Posts: 20
linuxfedorafirefox
Re: FAQ: Enabling 'NumLock' upon Boot/Entering X

Quote:
Originally Posted by vorte[x] View Post
Throw into rc.sysinit
[code:1]
for tty in /dev/tty[1-9]*; do
setleds -D +num < $tty
done
[/code:1]

Then for X, try putting this in .xinitrc
[code:1]
xset led 1
[/code:1]
Be careful with this !!

I just spent 3 Hours trying to get these lines back out with a VI editor under rescue system being the only way
The syntax is wrong for Fedora 12

Last edited by april; 26th June 2010 at 04:19 AM.
  #11  
Old 26th June 2010, 04:23 AM
Hlingler's Avatar
Hlingler Offline
Administrator
 
Join Date: Sep 2006
Location: Connellsville, PA, USA
Posts: 11,289
linuxkonqueror
Re: FAQ: Enabling 'NumLock' upon Boot/Entering X

You are correct: this thread is so old, and applies to a Fedora release(s) that is so that it's dangerous. Thread closed. Caveat Emptor.

V
Closed Thread

Tags
boot or entering, enabling, faq, numlock

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling keyboard during F11 live USB boot? cheerio158 Using Fedora 3 23rd December 2009 12:42 AM
quota enabling on boot failure jimmyp2 Using Fedora 2 27th November 2009 08:21 PM
Boot stops after enabling swap hvniekerk Using Fedora 3 22nd January 2008 05:49 PM
Boot without entering Password homeworx Using Fedora 5 13th October 2005 04:27 AM
Enabling NumLock? apox Using Fedora 3 29th December 2003 01:43 PM


Current GMT-time: 15:42 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat