Numlock switcher for X

Stuff that has yet to be sorted into a category.
Post Reply
Message
Author
User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Numlock switcher for X

#1 Post 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
Attachments
fixnumlock.tar.gz
(3.17 KiB) Downloaded 695 times

User avatar
jemimah
Posts: 4307
Joined: Wed 26 Aug 2009, 19:56
Location: Tampa, FL
Contact:

#2 Post 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

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#3 Post 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
Puppy Linux Blog - contact me for access

User avatar
Vyse
Posts: 30
Joined: Sat 15 Aug 2009, 15:30
Contact:

#4 Post 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!

User avatar
Fingers
Posts: 16
Joined: Sat 25 May 2013, 20:18
Location: London, UK

#5 Post 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 :)

Post Reply