Change mouse speed on Ubuntu 18.04

This worked for me:

xinput --set-prop 11 294 1

where:

11: is my mouse id, you should find and replace with yours

xinput --list --short

294: is the "Accel Speed" property id of my mouse. Just change 11 with your id and you can find your desired prop id with

xinput --list-props 11

1: the final number is the property value. For me default was 0, 1 accelerated the pointer up.

You can add the first command to the startup applications to keep the settings after a reboot. Instead of the device and prop id you can quote them in case they change after a reboot, ex:

xinput --set-prop 'Microsoft Basic Optical Mouse' 'libinput Accel Speed' 1

Source and more details taken from here: How to change mouse speed/sensitivity?


To solove the problem of "I'm using a 4K monitor and I already set my mouse speed to maximum."

  1. Find your mouse device ID

    Press crtl+alt+T to open the terminal.
    Type xinput --list --short.
    Under Virtual core pointer section, you should find your mouse id.
    My mouse is id=13.
    Note: It changes when you plug your mouse into a different port.

  2. Type xinput --list-props <device_id> (eg: xinput --list-props 13) to find the IDs for Coordinate Transformation Matrix (156) and libinput Accel Speed (297).
    Mine are 156 and 297.
    The default matrix is [1 0 0],[0 1 0],[0 0 1] (identity matrix).
    The maximum mouse speed is 1.0.

  3. Lower the mouse speed from graphic UI, while keep the terminal opens.

    Type xinput --list-props <device_id> again. If your libinput Accel Speed (297) lower than before, you are in the right place.

  4. Change the matrix.
    Set mouse speed to maximum by xinput --set-prop 13 297 1 (13 is my mouse device ID, and 297 is my libinput Accel Speed ID).

    Since the mouse speed cannot go beyond 1.0. Let's scale the position by change the x, y coordinates from the matrix.
    Try xinput --set-prop 13 156 2 0 0 0 2 0 0 0 1 (13 is my mouse device ID, and 156 is my Coordinate Transformation Matrix ID).
    If it's too fast, try 1.5 0 0 0 1.5 0 0 0 1. If it's still too slow, try 4 0 0 0 4 0 0 0 1.
    Only change the 1st two non-zero value, keep the last one as 1.

For full description on input coordinate transformation is here.


For me the suggested solutions broke synergy mouse control which I am using to control multiple machines.

I accidentally found that there is another mouse setting in gnome tweaks which doesnt break synergy and you can set everything though a UI.

To install: (copied from https://askubuntu.com/a/966634/1100244)

sudo apt install gnome-tweak-tool
gnome-tweaks  #  now launch it (alternative: press start button and type "tweaks")

In there go to "Keyboard & Mouse" => Mouse => Acceleration Profile. Change the setting from "Default" to "Flat". Enjoy your increased mouse speed ;)

Of course you can still use the normal mouse speed settings to fine tune the speed.

Screenshot of Gnome Tweak Tool Mouse Speed Settings with Acceleration Profile marked