kopia lustrzana https://github.com/FreeSpacenav/spacenavd
35 wiersze
767 B
Bash
Executable File
35 wiersze
767 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# this script, starts and stops the communication between spacenavd and the
|
|
# local X server. (:0).
|
|
|
|
if [ -z $1 ]; then
|
|
echo "you must run $0 with either \"start\" or \"stop\"."
|
|
exit 1
|
|
fi
|
|
|
|
if [ $1 = "start" ]; then
|
|
# check to see there is a local X server running.
|
|
DISPLAY=":0"
|
|
xdpyinfo >/dev/null 2>/dev/null
|
|
if [ $? != '0' ]; then
|
|
echo "You must have an X server running before starting up spacenavd-X11 events."
|
|
exit 1
|
|
fi
|
|
|
|
sig=-usr1
|
|
elif [ $1 = "stop" ]; then
|
|
sig=-usr2
|
|
else
|
|
echo "you must run $0 with either \"start\" or \"stop\"."
|
|
exit 1
|
|
fi
|
|
|
|
pid="`pidof spacenavd`"
|
|
if [ -n "$pid" ]; then
|
|
kill $sig $pid
|
|
echo "signalled spacenavd, it should now start sending X events."
|
|
else
|
|
echo "spacenavd daemon is not running, nothing to do."
|
|
fi
|