l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
April 21: Google Glass
Next Installfest:
TBD
Latest News:
Mar. 18: Google Glass at LUGOD's April meeting
Page last updated:
2002 Apr 19 00:55

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] more newbie questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] more newbie questions



> --- ORIGINAL MESSAGE ---
> Date: Thu, 18 Apr 2002 01:44:44 -0700
> From: Joey Karalius <jwkaralius@ucdavis.edu>
> To: vox-tech@lists.lugod.org
> Subject: [vox-tech] more newbie questions
> 
> I have a few questions for the group:
> 
> 1) How do I get NUM-LOCK to stay on when re-booting (Linux, of course)? 
>   I thought it was only a BIOS thing but apparently not, since it stays 
> on when Windows boots up, but not Linux.

It boils down to `setleds +num` call, you can put it in your .profile or .login if you want
Mandrake has a service in /etc/init.d called numlock that turns numlock on for all of the 
virtual consoles at startup. The code for the `numlock start` part of the service is as 
follows:

#snippet from /etc/rc.d/init.d/numlock in mandrake 8.2
  start)
        gprintf "Starting numlock: "
        echo_success
        echo
        touch $SYSCONF_FILE

        for tty in /dev/tty[1-8]; do
                setleds -D +num < $tty
        done

        ;;
#end snippet

For x-window, it's a little more difficult. Somewhere, I found a script that simulates 
pressing the numlock key once. (If numlock is off and you use it, then numlock turns on. If 
numlock is on and you press it, then numlock turns off.) Because I use XDM, I just compiled 
the program, and then modified /etc/X11/xdm/Xsetup_0 to run the program, so numlock is on by 
default for everyone.

You could also execute it from your .xinitrc or your .xsession

//numlock.c
//compile using:
//gcc -I/usr/X11R6/include -L/usr/X11R6/lib -o setnumlock Numlock.c -lX11 -lXtst
#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;
}
//end numlock.c


> 2) I bought a serial external modem, and I'm shopping for a cable. It 
> has the 25-pin connection on the back and I think I want to go with the 
> USB to serial cable, since I have a couple empty USB ports.  Is there 
> any reason I can't go with that setup?

I wish I knew stuff about USB. Maybe there will be something for me to learn about USB at 
sunday's installfest.
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
EDGE Tech Corp.
For donating some give-aways for our meetings.