18 November, 2010

Slow down your gaming mouse in Linux!

Last week I updated/added Ubuntu 10.10 to my gaming machine. But when trying to play some games via wine, I realized that my Sharkoon Fireglider was still too fast, even at the lowest settings. The Ubuntu mouse settings did not allow me to push the slider further down.

After some research I decided to write a little script that would allow me to do this manually. It sets the sensitivity and the acceleration to a desired number and outputs the current settings.

Here it is:

# bash script to slow down gaming mice even below the
# lowest values supported in XServer mouse config dialogs
# author: Uwe Jugel
# contact:
# license: creative commons, http://
# usage: ./slow-mouse [sensitivity] [acceleration]
# useful values for my Sharkoon Fireglider: 5,1


id=`xinput --list --short | grep -m1 $device_str | sed 's/.*id=//' | sed 's/\s*\[.*\].*//'`

echo "---------------------"
echo "old settings:"
xinput --list-props $id | grep -E Decel\|Scali
echo "---------------------"

echo "setting sens/accel to $sens/$accel"

`xinput --set-prop $id "Device Accel Constant Deceleration" $sens`
`xinput --set-prop $id "Device Accel Velocity Scaling" $accel`

echo "---------------------"
echo "new settings:"
xinput --list-props $id | grep -E Decel\|Scali
echo "---------------------"

1 comment:

victor smith said...

That's really a marvelous post. This post contains useful information which helps us a lot. I have never seen such a great post. Your wonderful post can inspire a lot and helps us. I visit your website often and share with my friend.
gaming mouse