Adding Repeater mode to gpm

Bosschert, B. (is-ks) Bas.Bosschert at soz.pinkroccade.nl
Mon Sep 24 05:15:43 PDT 2001


How about adding the Repeater mode for gpm. It is very handy, especially if
you're gonna install X.

The bootscript will be look something like:

cat > /etc/init.d/gpm << "EOF"
#!/bin/sh
# Begin /etc/init.d/gpm
 
#
# Include the functions declared in the /etc/init.d/functions file
#
 
source /etc/init.d/functions

# Get mouse configuration from /etc/sysconfig/mouse

if [ -f /etc/sysconfig/mouse ]
        then
                source /etc/sysconfig/mouse

elseif [ -z "$MDEVICE" ] || [ -z "$PROTOCOL" ]
        then
                echo "Please create an /etc/sysconfig/mouse file containing"
		echo "MDEVICE and PROTOCOL values"
		echo "REPEATER value is optional"
		exit 1;
fi

if [ -z "$REPEATER" ]
	REPEATER=""
else
	REPEATER=-R$REPEATER
fi

case "$1" in
        start)
                echo -n "Starting gpm mouse daemon..."
                loadproc gpm -m $MDEVICE -t $PROTOCOL $REPEATER
                ;;
 
        stop)
                echo -n "Stopping gpm mouse daemon..."
                killproc gpm
                ;;
 
        restart)
                $0 stop
                /usr/bin/sleep 1
                $0 start
                ;;
 
        status)
                statusproc gpm
                ;;
 
        *)
                echo "Usage: $0 {start|stop|restart|status}"
                exit 1
        ;;
 

And the config file will look like:

cat > /etc/sysconfig/mouse << "EOF" 
# start /etc/sysconfig/mouse
MDEVICE=yourdevice
PROTOCOL=yourprotocol
REPEATER=yourrepeatermode
# end /etc/sysconfig/mouse
EOF


Kind Regards,

Bas Bosschert
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-book' in the subject header of the message



More information about the blfs-book mailing list