I've got a USB mouse attached to my Ubuntu notebook. This mouse is (unfortunately) really sensitive, and so it sometimes gets hard to hit small icons with the mouse pointer. This is really a hardware issue, it's not a bug and it's not Ubuntu's/gnome's fault. Still, I would very much like to this issue through software (solving through hardware would imply buying a new mouse).

Back in Windows, if I set the sensitivity as really low it was comfortable enough. In Ubuntu, even the lowest sensitivity and acceleration available (in the System>Prerences>Mouse menu) is still frustrating. How can I decrease it below the default minimum?

I tried xset, but it seems xset only deals with acceleration and threshold, but not actual sensitivity.

  • 1
    Where do i put these lines of code? – user430966 Jul 18 '15 at 23:58

I have a Razer DeathAdder mouse and like in your case, the sensitivity/acceleration are too high even if I put them at the lowest level in the mouse preferences. So to solve this problem, I used the xinput command.

First, you will need your mouse ProductName and ID:

xinput list
 Razer Razer DeathAdder                     id=8    [slave  pointer  (2)]

Then you set the constant deceleration level that suits your needs with this command:

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

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.

Once you reboot, you should have the same result as the xinput command.

Let me know if it helps.

| improve this answer | |
  • Amazing! I had given it up weeks ago. Thank you so much, it does indeed help. – Malabarba Nov 9 '10 at 11:18
  • 5
    Bah: "property 'Device Accel Constant Deceleration' doesn't exist, you need to specify its type and format – mlissner May 3 '13 at 16:12
  • 1
    Still works, even for Linux Mint 17! Thanks :) – Richard de Wit Jun 5 '15 at 12:19
  • 3
    if I don't have the xorg.conf file, should I create it ? – Ciprian Tomoiagă Aug 5 '16 at 22:58
  • 1
    @mlissner try a different divice id, mine has 3 pointers, and I had to use 10 – flcoder Oct 3 '16 at 12:19

Ubuntu 17.04

Follow the instructions below, but change:

xinput set-prop 10 "Device Accel Constant Deceleration" 3


xinput set-prop 10 "libinput Accel Speed" -0.4

Thank you @tambre. Not sure this is quite as ideal as the old setting, but it's pretty close.

xset m 3

That still works pretty darn well. Need to figure out how to save so this is the default on reboot.

Ubuntu 16.04

@JackTravis 's answer was incredibly helpful, but I think it's worth updating for 16.04 because the xorg.conf file has moved and been split into multiple files. Before writing this answer, I tried using xset and played around with the xinput settings for a while before deciding that JackTravis's xinput ConstantDeceleration 3 setting was the best one for both my Logitech M510 on my desktop and some older wired mouse on my laptop.

1. List Mice

$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech M510                             id=10   [slave  pointer  (2)]
⎜   ↳ Synaptics Inc. Composite TouchPad / TrackPoint    id=13   [slave  pointer  (2)]

My mouse was the Logitech M510, id=10 so I'm going to use that in this example. You will need to replace that with whatever your mouse is called. Now, use xinput set-prop to try out various settings until your mouse moves exactly as you want it to. The 10 in the following corresponds to the id=10 for my mouse on my system. You'll probably have to change that.

2. Change Your Settings Temporarily

$ xinput set-prop 10 "Device Accel Constant Deceleration" 3

If you're curious what other settings affect your device try

$ xinput --list-props 10

To clear the settings after I had really messed them up, all I had to do was unplug and re-plug my mouse.

3. Save the New Setting Permanently

If you like ConstantDeceleration of 3, then you need to add an xorg.conf file the new Ubuntu 16.04 way: by adding a new file in /usr/share/X11/xorg.conf.d/ You will want to change Logitech M510 and logitech-m510 in the file name to match your mouse. I think the 60- at the beginning of the file name is the priority with which these files are loaded. The following one-line shell command is what I put in my machineSetup.sh file in Dropbox so that I can quickly customize a new machine exactly how I like it within minutes of a fresh install:

sudo sh -c "echo 'Section \"InputClass\"\n\
   Identifier      \"My awesome new mouse\"\n\
   MatchProduct    \"Logitech M510\"\n\
   Option          \"ConstantDeceleration\" \"3\"\n\
EndSection\n' > /usr/share/X11/xorg.conf.d/60-logitech-m510.conf"

OR, if you want to do it the GUI way, open an editor as root then paste and edit the following into /usr/share/X11/xorg.conf.d/60-<whatever>.conf

Section "InputClass"
   Identifier      "My Awesome Blue Mouse"
   MatchProduct    "Logitech M510"
   Option          "ConstantDeceleration" "3"

4. Reboot

That's it. Just reboot and verify that the new settings took effect.

| improve this answer | |
  • 1
    I unfortunately get the following: property 'Device Accel Constant Deceleration' doesn't exist, you need to specify its type and format when trying the command in the 2nd step (with my device id). – tambre Feb 11 '17 at 10:54
  • @tambre my guess is that you did not use the correct numerical ID identified in step 1 when you did step 2. If that's not the case, then I'm probably not going to know enough to be able to help you. – GlenPeterson Feb 12 '17 at 18:36
  • 1
    After listing the properties, Device Accel Constant Deceleration doesn't exsist there. It seems to be using libinput as the driver, so I had to modify the value of libinput Accel Speed, whose valid values are from -1 to 1, instead. – tambre Feb 12 '17 at 19:08
  • 1
    This worked for me, but my mouse (a "Razer Razer DeathAdder 2013") showed up multiple times under Virtual core pointer (twice) and Virtual core keyboard (once). Only the pointer devices had Device Accel Constant Deceleration, so I had to make sure to select one of those devices when testing with xinput. The xorg.conf.d file still worked perfectly. – Alex Mar 18 '17 at 19:19
  • To slow down the mouse at system startup, you can make Ubuntu run a bash script at startup. First, make a shell script (say, 'slow_mouse.sh') containing the 'xinput' command: #!/bin/bash xinput set-prop 12 "libinput Accel Speed" -0.9999999 Make it executable in terminal: $ chmod u+x slow_mouse.sh Then add this script to startup by running 'Startup Application Preferences' (use Unity search to find it) and adding this shell script you just created. – Calleniah Mar 1 at 15:58

Late reply, but I think this is worth posting:

Since we're talking about gaming mouse here. Better is to turn off the mouse acceleration entirely (useful for FPS gamers etc.). Save up some CPU cycles by not using it to calculated any mouse acceleration and likely to be more accurate readings too (depend or the mouse hardware sensor has build-in extrapolation).

xinput set-prop <mousedevice_nr> "Device Accel Profile" -1


Section "InputClass"
   Identifier      "Razer"
   MatchProduct    "Razer DeathAdder"         # Product name from xinput list.
   Option          "AccelerationProfile" "-1" # Turn mouse accel off saving CPU cycles


| improve this answer | |
  • I get this: X Error of failed request: BadValue (integer parameter out of range for operation). – MasterOfBinary Aug 9 '16 at 10:33
  • great this was awesome thank you. I'm having issues with my Kingsis Peripherals Evoluent VerticalMouse 3. It has a DPI setting on the bottom of the mouse and at its highest DPI settings - even the lowest sensitivity settings are still too high. – anon58192932 Sep 20 '17 at 17:20

A slight modification to Glen's answer, this works for my Logitech mouse and doubles "slowness" from 1 to 2.

Add to ~/.profile (as pointed out in comment) (or .bashrc but then you have to launch a terminal for the change to take place)

MOUSE_ID=`xinput list | grep Mouse | awk '{print $(NF-3)}' | cut -c4-5`
xinput set-prop $MOUSE_ID "Device Accel Constant Deceleration" $MOUSE_SLOWNESS
| improve this answer | |
  • 1
    I think it is better to add those lines to the end of .profile instead of .bashrc. .profile is only run by interactive login shells meanwhile .bashrc will run every time a bash shell is started. See this answer for more information. – chus Jun 28 '17 at 0:49
  • technically .bash_aliases work work as well since the standard ubuntu .bashrc file loads it correct? – anon58192932 Sep 20 '17 at 17:21

If you use the PS2 port the mouse movement is much slower for the same mouse resolution.

For your mouse try to use a USB to PS2 converter and put the mouse it the PS2 port.


I have found the xorg.conf working solution:

Section "InputDevice"
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Sensitivity" "0.2"

Where a sensitivity of 1 is the default and the 0.2 one is decreasing it five times.

| improve this answer | |
  • That's a creative idea. I think I've got a converter back at home, so I'll try it tomorrow. – Malabarba Oct 27 '10 at 17:26
  • I have found a working xorg.conf solution. Edited answer. – iugamarian Feb 17 '11 at 12:48
  • 1
    This won't work on laptops, though. – Daniel Silva May 5 '17 at 9:51
  • Where is xorg.conf? – Green Feb 4 '18 at 12:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.