Allow moused to have configs per port

This commit is contained in:
Roy Marples 2007-12-04 12:25:12 +00:00
parent 8cfb8f1333
commit bb2b8f383f
2 changed files with 17 additions and 9 deletions

View File

@ -4,11 +4,13 @@
# Leave blank to try to autodetect it # Leave blank to try to autodetect it
#moused_device="/dev/psm0" #moused_device="/dev/psm0"
# Any additional arguments required # Any additional arguments required for a specific port
moused_args="" #moused_args_psm0=""
# or for all mice
#moused_args=""
# You can also multiplex the init script for each device like so # You can also multiplex the init script for each device like so
# ln -s moused /etc/init.d/moused.ums0 # ln -s moused /etc/init.d/moused.ums0
# This enables you to have a config file per mouse (forces MOUSED_DEVICE # This enables you to have a config file per mouse (forces moused_device
# to ums0 in this case) and control each mouse. # to ums0 in this case) and control each mouse.
# devd can also start and stop these mice, which laptop users will find handy. # devd can also start and stop these mice, which laptop users will find handy.

View File

@ -59,16 +59,22 @@ start() {
return 1 return 1
fi fi
local args=
eval args=\$moused_args_${moused_device##*/}
[ -z "${args}" ] && args=${moused_args}
start-stop-daemon --start --exec /usr/sbin/moused \ start-stop-daemon --start --exec /usr/sbin/moused \
--pidfile "${pidfile}" \ --pidfile "${pidfile}" \
-- ${moused_args} -p "${moused_device}" -I "${pidfile}" -- ${args} -p "${moused_device}" -I "${pidfile}"
local retval=$? local retval=$?
local ttyv= if [ ${retval} = 0 ]; then
for ttyv in /dev/ttyv*; do local ttyv=
vidcontrol < "${ttyv}" -m on for ttyv in /dev/ttyv*; do
: $((retval+= $?)) vidcontrol < "${ttyv}" -m on
done : $((retval+= $?))
done
fi
eend ${retval} "Failed to start moused" eend ${retval} "Failed to start moused"
} }