123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- diff --git a/udev/toudev.awk b/udev/toudev.awk
- index 822421d..ada40e5 100644
- --- a/udev/toudev.awk
- +++ b/udev/toudev.awk
- @@ -1,15 +1,20 @@
- #!/bin/awk -f
- BEGIN {
- FS = ","
- + print "# udev.rules file for Logitech mouse control using lomoco"
- + print "#"
- + print ""
- print "ACTION != \"add\", GOTO=\"lomoco_end\""
- - print "SUBSYSTEM != \"usb\", GOTO=\"lomoco_end\""
- - print "SYSFS{idVendor} != \"046d\", GOTO=\"lomoco_end\""
- + print "SUBSYSTEM == \"usb\", ENV{DEVTYPE}==\"usb_device\", GOTO=\"lomoco_start\""
- + print "SUBSYSTEM != \"usb_device\", GOTO=\"lomoco_end\""
- + print ""
- + print "LABEL=\"lomoco_start\""
- print ""
- }
-
- $1 ~ /0xc[a-f0-9][a-f0-9][a-f0-9]/ {
- print "# " substr($3, index($3, "\"")) ", " $2
- - print "SYSFS{idProduct}==\"" substr($1, index($1, "x")+1) \
- + print "ATTRS{idVendor}==\"046d\", ATTRS{idProduct}==\"" substr($1, index($1, "x")+1) \
- "\", RUN=\"lomoco\""
- }
-
- diff --git a/udev/udev.lomoco b/udev/udev.lomoco
- index 9e55511..da896d9 100755
- --- a/udev/udev.lomoco
- +++ b/udev/udev.lomoco
- @@ -1,26 +1,36 @@
- -#!/bin/bash
- -
- -case "$DEVPATH" in
- - *usbdev*.*)
- - dev=${DEVPATH##*usbdev}
- - bus=$(printf %03d ${dev%.*})
- - dev=$(printf %03d ${dev#*.})
- -
- - . /etc/sysconfig/logitech_mouse
- -
- - options=
- -
- - if [ -n "$LOGITECH_MOUSE_RESOLUTION" ]; then
- - options="--$LOGITECH_MOUSE_RESOLUTION"
- - fi
- -
- - if [ -z "$LOGITECH_MOUSE_DISABLE_CC" -o "$LOGITECH_MOUSE_DISABLE_CC" = yes ]; then
- - options="$options --no-sms"
- - fi
- -
- - if [ -n "$options" ]; then
- - /usr/bin/lomoco -b $bus -d $dev $options
- - fi
- - ;;
- -esac 2>&1 | /bin/logger -t lomoco
- -
- +#!/bin/sh
- +#
- +# udev helper script for the locomo utility
- +#
- +
- +test -x /usr/bin/lomoco || exit 0
- +test -r /etc/lomoco.conf || exit 0
- +
- +options=
- +. /etc/lomoco.conf
- +
- +if [ -n "$LOGITECH_MOUSE_RESOLUTION" ]; then
- + options="--$LOGITECH_MOUSE_RESOLUTION"
- +fi
- +
- +if [ -z "$LOGITECH_MOUSE_DISABLE_CC" -o "$LOGITECH_MOUSE_DISABLE_CC" = yes ]; then
- + options="$options --no-sms"
- +fi
- +
- +if [ -n "$BUSNUM" ]; then
- + options="$options -b $BUSNUM"
- +fi
- +
- +if [ -n "$DEVNUM" ]; then
- + options="$options -d $DEVNUM"
- +fi
- +
- +if [ -n "$MODEL_ID" ]; then
- + options="$options -p $MODEL_ID"
- +fi
- +
- +if [ -n "$options" ]; then
- + /usr/bin/lomoco $options 2>&1 | \
- + sed -e 's/^[[:blank:]]\+//' -e 's/ \+$//' -e '/^$/ d' | \
- + logger -t lomoco -p daemon.info
- +fi
|