I have a G700 mouse connected to my computer. The problem with this mouse in Linux (Ubuntu) is that the sensitivity is very high. I also don\'t like mouse acceleration, so I
You can do something like the following.
if [ "$SEARCH" = "" ]; then
exit 1
fi
ids=$(xinput --list | awk -v search="$SEARCH" \
'$0 ~ search {match($0, /id=[0-9]+/);\
if (RSTART) \
print substr($0, RSTART+3, RLENGTH-3)\
}'\
)
for i in $ids
do
xinput set-prop $i 'Device Accel Profile' -1
xinput set-prop $i 'Device Accel Constant Deceleration' 2.5
xinput set-prop $i 'Device Accel Velocity Scaling' 1.0
done
So with this you first find all the IDs which match the search pattern $SEARCH and store them in $ids.
Then you loop over the IDs and execute the three xinput commands.
You should make sure that $SEARCH does not match to much, since this could result in undesired behavior.