47 printf "\nERROR:invalid dpi (40-1600/40 increment)\n"
61 printf "\nERROR:invalid effect (steady|slow|breath|pulsing)\n"
67 # not implemented, because factory default value is ok
68 # set polling rate in Hz:
70 # suffix=00 00 00 00 00 00
75 # 1000 Hz=02 (factory default)
77 # not implemented, because no use for it
78 # button 6 (wheel button) action:
80 # suffix=00 00 00 00 00 00 00
85 USAGE
="Usage: $0 -c color(hex 3 bytes rrggbb) -s1 dpi1(200-7200/100 increment) -s2 dpi2(100-7200/100 increment) -e effect(steady|slow|breath|pulsing) -s"
86 if test $# -eq 0; then
93 for l
in /sys
/class
/hidraw
/*; do
94 if readlink
-f $l |
egrep '1038:1729' >/dev
/null
2>&1; then
95 rival110
=/dev
/$
(basename $l)
100 if test "${rival110-unset}" = unset; then
101 echo ERROR
:unable to
locate a rival110
107 while test $# -ne 0; do
110 if test "$2" = ""; then
118 if test "$2" = ""; then
119 echo missing sensitivity
1
126 if test "$2" = ""; then
127 echo missing sensitivity
2
134 if test "$2" = ""; then
152 # each command is padded to 9 bytes
153 if test "${rgb_hex-unset}" != unset; then
154 echo "rgb_hex=$rgb_hex";
155 cmd_hex
=0500${rgb_hex}00000000
157 if test "${sensitivity_1-unset}" != unset; then
158 printf "sensitivity_1=$sensitivity_1 dpi"
159 dpi_to_hex sensitivity_1
$sensitivity_1
160 echo "/hexcode=$sensitivity_1"
161 cmd_hex
=${cmd_hex}0301${sensitivity_1}000000000000
163 if test "${sensitivity_2-unset}" != unset; then
164 printf "sensitivity_2=$sensitivity_2 dpi"
165 dpi_to_hex sensitivity_2
$sensitivity_2
166 echo "/hexcode=$sensitivity_2"
167 cmd_hex
=${cmd_hex}0302${sensitivity_2}000000000000
169 if test "${effect-unset}" != unset; then
170 printf "effect=$effect"
172 echo "/hexcode=$effect"
173 cmd_hex
=${cmd_hex}0700${effect}000000000000
175 # must be last for an obvious reason
176 if test "${save-unset}" != unset; then
177 echo "****will save settings in mouse persistent memory****"
178 cmd_hex
=${cmd_hex}090000000000000000
180 printf $cmd_hex | xxd
-r -p >$rival110