Mouse acceleration
Setting the mouse acceleration depends on the windowing protocol you are using: either Xorg or Wayland.
- On Xorg, there are several ways of setting mouse acceleration
- by editing Xorg configuration files
- xorg-xset and xorg-xinput which provide xset and xinput respectively
- and configuration interfaces common in desktop environments.
- If you are using Wayland, the events are controlled via libinput. It is the compositor's job to expose the settings brought by libinput. There is currently no standard way to change settings across compositors.
- GNOME manages mouse acceleration by itself. A choice between "adaptive" and "flat" profiles can be chosen by installing dconf-editor and editing the value in org/gnome/desktop/peripherals/mouse/acceleration-profile. Alternatively, gnome-tweaks can also be used to edit the org/gnome/desktop/peripherals/mouse/acceleration-profile.
Mouse acceleration with libinput
When using the adaptive pointer acceleration profile, libinput calculates the mouse acceleration depending on the DPI and the parameter . libinput relies on the resolution reported by evdev . Feedback settings set with are effectively ignored. When using the flat pointer acceleration profile, the acceleration factor is constant regardless of the velocity of the pointer. This provides 1:1 movement between the device and the pointer on-screen.
Changing the acceleration
Find the id of your device with and set the acceleration speed with the following command. Note that the acceleration speed has to be in the range of [-1,1]. Check this plot to see the impact of different acceleration speed values.
$ xinput --set-prop <device id> 'libinput Accel Speed' <acceleration factor>
Confirm your changes with the following:
$ xinput --list-props <device id>
Persistent configuration
libinput does not store configuration options, it is up to the caller to manage these. Under Wayland configuration is restored by the desktop environment. Under X xf86-input-libinput reads the xorg configuration files and applies the options . To make changes persistent under X create a file like this:
For further options see .
Setting mouse acceleration
In Xorg configuration
See for details.
Examples:
You can also assign settings to specific hardware by using "MatchProduct", "MatchVendor" and other matches inside class sections. Run to find out the product name and vendor to match:
$ lsusb -v | grep -e idProduct -e idVendor
If you are unable to identify your device, try running . Some devices the use Logitech Unifying Recceiver share the same USB connection therefore, the mouse do not appear using
Using xinput
First, get a list of devices plugged in (ignore any virtual pointers):
$ xinput list
Take note of the ID. You may also use the full name in commands if the ID is prone to changing.
Get a list of available properties and their current values available for modification with
$ xinput list-props 9
where is the ID of the device you wish to use. Or
$ xinput list-props "mouse name"
where is the name of your mouse given by .
Example, changing the property of to 2:
$ xinput --set-prop "mouse name" "Device Accel Constant Deceleration" 2
To make it permanent, edit Xorg configuration (see above) or add commands to xprofile. The latter will not affect speed in a display manager.
Configuration example
You may need to resort to using more than one method to achieve your desired mouse settings. Here is what I did to configure a generic optical mouse: First, slow down the default movement speed 3 times so that it is more precise.
$ xinput --set-prop 9 'Device Accel Constant Deceleration' 3 &
Then, enable acceleration and make it 3 times faster after moving past 6 units.
$ xset mouse 3 6 &
If you are satisfied with the results, store the preceding commands in ~/.xinitrc
.
Disabling mouse acceleration
Mouse acceleration has changed dramatically in recent X server versions; using to disable acceleration does not work as it used to and is not recommended anymore. Recent changes on PointerAcceleration
can be read here.
Disabling the mouse acceleration means that a linear function will be used to map from physical to virtual mouse movements. The mouse speed setting controls the inclination of this linear function.
To completely disable any sort of acceleration/deceleration, create the following file: and restart X.
with libinput
Alternatively, since -1.1.0-1 and xf86-input-libinput-0.15.0-1 you can use a flat acceleration profile. To enable it create the following file:
and restart X. Notice that under certain conditions (for example if you have a different value for your mouse in Plasma 5.13) your desktop environment may try to override some of these values even if you have this X configuration file.
Another option is this command:
$ xinput --set-prop device-id 'libinput Accel Profile Enabled' 0, 1
Which does not need an X restart, but is not persistent. Although it can be set up to run automatically with Autostarting.
To confirm that acceleration has been disabled, enter the following:
$ xinput list-props {1..50} 2>/dev/null | grep -F 'libinput Accel Profile Enabled ('
The profile should read .