Page 1 of 1

Numlock switcher for X

Posted: Fri 23 Oct 2009, 16:03
by vovchik
Dear Puppians,

I had a weird experience today installing Puppy Jaunty on a Packard-Bell EasyNote laptop. A friend was willing to let me trash his pre-installed Vista for Puppy, an opportunity for which I am grateful, coming as it did on the launch day of M$ Win7. He would be an influential Puppy convert/advocate since he is a rector of a university in Germany. Everything went fine except for the Xorg language settings. I have four languages on my three computers and did the same for him. Oddly, whenever I tried typing anything in the three additional languages, I would get crap on the right side of the keyboard, starting with the letter "k". I could not for the life of me figure out what was wrong. Eventually, to our mutual embarrassment, I figured it out: numlock was on by default and there was no indicator lamp to tell us. I looked in the bios for a way to turn it off by default, but the Packard-Bell implementation is a very abbreviated affair with no numlock setting that I could see.

So, I compiled a little program called numlockx, which can toggle the state of that key. It can be placed in root/.xinitrc or in the /root/Startup dir. It knows only two arguments:

Code: Select all

numlockx on
numlockx off
Now, everything is all sweetness and light in EasyNote-land. Long live Puppy!

Here is the tiny binary (4k), which I tested in 3.x and 4.x.

With kind regards,
vovchik

Posted: Fri 23 Oct 2009, 21:50
by jemimah
There's also a more generalized version of this called xte that can be used to press any button you want from a script.

http://linux.die.net/man/1/xte

You can get it here: http://hoopajoo.net/projects/xautomation.html

Posted: Sat 24 Oct 2009, 23:25
by 01micko
Hello vovchik

Very nice little app. I put the binary in my path (/usr/bin if I recall) and made a simple script and put it in /root/Startup such that my numlock is on at boot and X restart.

Code: Select all

#!/bin/sh
numlockx on &
Thank you and Cheers

Mick

Posted: Sun 25 Oct 2009, 11:23
by Vyse
@vovchik
Thanks a lot!! This is exactly what I was looking for..no more turning the numlock manually after each start!

Long live Puppy!

Posted: Wed 19 Jun 2013, 13:45
by Fingers
fatdog64 users: search for numlockx in the Package Manager (in Control Panel > System) and install it there. Option to have numlock on at startup is provided :)