Mouse Sensitivity in Linux

Whether you are talking about mouse speed, sensitivity, or acceleration in linux, adjustment is often difficult.

Mouse is very sensitive in most systems with wireless mouse. The mouse pointer sensitivity is too high and the controls in System Settings don't give the user enough control to reduce it to a useable level. The "Sensitivity" setting seems to do almost nothing. It used to be labeled "Threshold" and it seems to act in reverse of what you might be trying to accomplish.

In working with Linux for over 20 years now it still seems as though the developers pay little attention to quality mouse control applets and utilities. It seems to be hit and miss, and while I appreciate the open source nature of Linux, this has to be one of the biggest hindrances towards wide spread acceptance of this operating system when it is so difficult to tame the average mouse pointing device.

xinput and xset

The suggestions below are useful for experimentation. As the old cliche goes, your actual mileage may vary.

xinput method

This works in newer Mint and Ubuntu distributions.

When you type

 xinput --list --short

There will be a lot of output on the screen and more than one mention of a mouse in the list. It is recommended you run this command with the mouse connected, then again with the mouse disconnected. Note the change. Whichever was absent when the mouse was disconnected will likely be your mouse.

In a test example we noted that "PixArt Gaming Mouse" with an id=8 was only visible in the output of xinput --list --short when the mouse was connected. Looks like:

 ↳ PixArt Gaming Mouse                     	id=8	[slave  pointer  (2)]

With this information there are some different tricks to taming the mouse.

It was said on linuxmint.com that "You may have to play around with the values. Constant Deceleration of 1 is very slow, 9 is very fast."

The following command example utilizes the ID of the mouse

xinput set-prop 8 "Device Accel Constant Deceleration" 3
# 8 = DEVICE_ID
# 3 = LEVEL (factor) Higher = Slower.

The following command examples utilize the NAME of the mouse rather than the ID.

xinput --set-prop "PixArt Gaming Mouse" "Device Accel Constant Deceleration" 2
xinput --set-prop "PixArt Gaming Mouse" "Device Accel Velocity Scaling" 1
xinput --set-prop "PixArt Gaming Mouse" "Device Accel Profile" -1

To make the config persistent (and make it system wide), you will need to edit your xorg.conf (/etc/X11/xorg.conf).

Section "InputClass"
  Identifier      "Razer"                    # Whatever you want.
  MatchProduct    "Razer Razer DeathAdder"   # Product name from xinput list.
  Option          "ConstantDeceleration" "3" # The same value as xinput.
EndSection

Here is another xinput suggestion found on stackexchange...

xinput --set-prop 8 269 -0.5

Where the 8 is the mouse id, 269 is the code for "libinput Accel Speed", and the -0.5 is telling it to go slower (I guess 0 is the baseline, so to slow it, you go below 0). If that's still too fast, you can try -0.6, -0.7, etc. To reset it, set it back to 0.0.


xset method

Note: You will not be able to use xset on newer distributions such as Linux Mint 19 it appears to be using libinput as the default input device driver.

Find the initial setting

xset -q | grep accel

Modify the acceleration

xset m 1/3

or

xset m 4/10

or

xset m 1/2 4

Try a fract ion that works for you

To reset default values:

xset m default

Edit ~/.config/autostart/mouse.desktop to make changes stick

libinput

In desktop environments like Xfce, KDE Plasma and Cinnamon you'll find an option to disable the mouse acceleration in the Mouse section of System Settings. However, users are complaining that the option does not work and the mouse acceleration seems to remain enabled.

completely disable mouse acceleration (verified)

As described in the section "xinput method" we will use xinput to find out the Identifier (name) for our mouse.

xinput --list --short

To disable acceleration you can create the following file:

vi /usr/share/X11/xorg.conf.d/50-mouse-acceleration.conf

And use the following

Section "InputClass"
        Identifier "My Mouse"
        Driver "libinput"
        MatchIsPointer "yes"
        Option "AccelProfile" "flat"
EndSection
  • Make sure you replace "My Mouse" with the name identifier of your mouse that you obtained from using "xinput --list --short"
  • This will require a reboot before you notice the impact
  • Verified on Linux Mint 19.2, by eliminating acceleration the mouse moves slower, allowing for greater precision for tasks such as graphic manipulation or CAD.

gnome-tweaks

This is for Ubuntu users only. Ubuntu and Debian users can install Gnome Tweaks using:

sudo apt install gnome-tweaks

To disable mouse acceleration launch the Tweaks app, click on Keyboard & Mouse on the left, and select Flat under Acceleration Profile for your mouse. This feature requires minimum of Gnome 3.22 and is present in Ubuntu 20.10, 20.04, 19.10, 19.04, 18.10 and 18.04, however is not available for Ubuntu 16.04 or older.

mouse scroll speed

You won’t find the settings for changing mouse scroll speed. Because by default Linux mint does not support this feature.

cinnamon

There is a third party utility called imwheel that is helpful

sudo apt install imwheel

Use this utility to make the adjustment. You will have to launch the utility after each reboot as settings are not retained. To retain, you must create a startup script.

To add IMWHEEL to your startup app list go to startup app settings then click on the Plus button -> Custom Command. Then in the name and command field enter imwheel like the image below. Then click Add button to add the imwheel to startup list.

The issue has been reported with some distributions

Lack of control for Linux Mint 19 users:

Last modified on 3 November 2020, at 15:37