#!/bin/sh
# Start/stop/restart the GPM mouse server:

if [ "$1" = "stop" ]; then
  echo "Stopping gpm..."
  /usr/sbin/gpm -k
elif [ "$1" = "restart" ]; then
  echo "Restarting gpm..."
  /usr/sbin/gpm -k
  sleep 1
  /usr/sbin/gpm -m /dev/mouse -t imps2
else # assume $1 = start:
  echo "Starting gpm:  /usr/sbin/gpm -m /dev/mouse -t imps2"
  /usr/sbin/gpm -m /dev/mouse -t imps2
fi

# There is another way to run GPM, where it acts as a repeater outputting a
# virtual MouseSystems mouse on /dev/gpmdata.  This is useful for feeding
# gpm's data to X, especially if you've got a busmouse (in that situation X
# and gpm may not coexist without using a repeater).  To try running a GPM
# repeater for X, change the gpm command line to look like this:
# /usr/sbin/gpm -R msc -m /dev/mouse -t imps2
# Then, make sure that the mouse configuration in your XF86Config file refers
# to the repeater device (/dev/gpmdata) and a MouseSystems mouse type.  If you
# edit the file directly, you'll want the lines to look like this (minus the
# comment marks '#' shown here, of course):
#Section "Pointer"
#    Protocol    "MouseSystems"
#    Device      "/dev/gpmdata"

Valid HTML 4.01!