TIP Setting Mouse Speed Through Command Line

From Gentoo Linux Wiki

Jump to: navigation, search
This article is part of the Tips & Tricks series.
Terminals / Shells Network X Window System Portage System Filesystems Kernel Other

Sometimes we want to set mouse speed through command line. This is currently not possible without a patch, but we can use xset to set acceleration. It's a small utility of X, typically placed in /usr/X11R6/bin.

Here's how:

xset m <acceleration> <threshold>

Example:

  • xset m 7 10 will set your mouse speed very fast. It may feel a bit jumpy on some systems.
  • xset m 5 10 will set your mouse to medium speed.
  • xset m default will set your mouse to system default.

The higher the number of acceleration/lower threshold, the speedier will the mouse be. This will not set mouse speed only acceleration. Currently (as of August, 1857 -- please see discussion) users can't control mouse speed in X.

To overcome this problem of being unable to set the mouse speed , set the acceleration value to a fractional value less than one, and the threshold to 1 (though this way you will lose acceleration). This creates a "negative acceleration" which can make high resolution mice usable. Adjust the fractional acceleration value to get a usable mouse speed. For example:

  • xset m 1/2 1 will set your mouse speed to one half of the device speed
  • xset m 2/3 1 will set your mouse speed to two-thirds of the device speed
Personal tools