Configuring my mouse on Linux hasn’t been too important as I tend to be using my mouse on a desktop computer. More desk space means more elbowroom to move around, so I don’t do anything fancy with the mouse “acceleration”.

However, working on a laptop changes this because I’m typically working with limited space. To maximize efficiency, slow movements should be more accurate, easing (for example) the selection of text. Quick movements can jump the cursor to the other side of the screen without having to pull the mouse off the mousepad.

Another thing I had to accommodate for (while using a laptop) is that I usually have different devices plugged in, at different times. This means that the device ID changes, depending what is plugged in. This makes it a pain in the arse to automate.

This line lists the devices and then greps the lines to find the ID of the Razer Mouse.

razer_mouse_id=$(xinput | grep -m 1 "Razer Razer DeathAdder 2013" | awk {'print substr($7,4,2)'})

These lines then use the newly created $razer_mouse_id variable and sets up my deceleration settings. “Constant Deceleration” sets the overall speed (fastest speed), while “Velocity Scaling” sets the polling speed, how often we check (poll) the position of the mouse. The “Adaptive Deceleration” then determines just how much we effect the sensitivity of the mouse down when it’s moving… slowly (if I’m understanding this correctly).

In any case, these are the settings that are working for me… for now.

xinput set-button-map $razer_mouse_id 1 2 3 4 5 6 7 2 2

xinput --set-prop $razer_mouse_id "Device Accel Constant Deceleration" 1
xinput --set-prop $razer_mouse_id "Device Accel Adaptive Deceleration" 2
xinput --set-prop $razer_mouse_id "Device Accel Velocity Scaling" .5