#!/bin/sh

# run-math.sh version 4
# `-r' flag means don't use the "Configurator"
# and pass wheel events to the root window
#
# Ensure a single instance of Mathematica with
# the option `-singleLaunch'.
# Allow the use of the NumLock key with the 
# '-primaryModifierMask' and '-secondaryModifierMask'
# switches.

MARGS="-singleLaunch -primaryModifierMask Mod1Mask -secondaryModifierMask Mod3Mask"

if `ps -C imwheel > /dev/null`; then
  Mathematica $1 $MARGS
else
  imwheel -r
  Mathematica $1 $MARGS 
  imwheel -kq
fi



