1. Introduction

In this tutorial, we’ll adjust the mouse sensitivity in Linux in a terminal. It was written for Ubuntu Linux but will work for most other Debian-based distributions, like Linux Mint.

While there are several approaches to configuring the mouse speed using the Linux command line, the only one that works reliably seems to be using xinput.

2. Listing and Identifying Configurable Devices Using xinput –list

Use the command xinput to list all configurable devices:

$ xinput --list --short
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ SynPS/2 Synaptics TouchPad id=10 [slave pointer (2)]
⎜ ↳ TPPS/2 IBM TrackPoint id=11 [slave pointer (2)]

In this example, we’ll adjust the speed of my Thinkpad’s trackpoint. Copy the name of the device and use the following command to list all configurable attributes:

$ xinput --list-props "TPPS/2 IBM TrackPoint"
Device 'TPPS/2 IBM TrackPoint':
Device Enabled (185): 1
Coordinate Transformation Matrix (187): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000
libinput Natural Scrolling Enabled (322): 0
libinput Natural Scrolling Enabled Default (323): 0
libinput Scroll Methods Available (326): 0, 0, 1
libinput Scroll Method Enabled (327): 0, 0, 1
libinput Scroll Method Enabled Default (328): 0, 0, 1
libinput Button Scrolling Button (352): 2
libinput Button Scrolling Button Default (353): 2
libinput Button Scrolling Button Lock Enabled (354): 0
libinput Button Scrolling Button Lock Enabled Default (355): 0
libinput Middle Emulation Enabled (332): 0
libinput Middle Emulation Enabled Default (333): 0
libinput Accel Speed (334): 0.000000
libinput Accel Speed Default (335): 0.000000
libinput Accel Profiles Available (336): 1, 1, 1
libinput Accel Profile Enabled (337): 1, 0, 0
libinput Accel Profile Enabled Default (338): 1, 0, 0
libinput Accel Custom Fallback Points (339): <no items>
libinput Accel Custom Fallback Step (340): 0.000000
libinput Accel Custom Motion Points (341): <no items>
libinput Accel Custom Motion Step (342): 0.000000
libinput Accel Custom Scroll Points (343): <no items>
libinput Accel Custom Scroll Step (344): 0.000000
libinput Left Handed Enabled (345): 0
libinput Left Handed Enabled Default (346): 0
libinput Send Events Modes Available (299): 1, 0
libinput Send Events Mode Enabled (300): 0, 0
libinput Send Events Mode Enabled Default (301): 0, 0
Device Node (302): "/dev/input/event6"
Device Product ID (303): 2, 10
libinput Drag Lock Buttons (347): <no items>
libinput Horizontal Scroll Enabled (348): 1
libinput Scrolling Pixel Distance (349): 15
libinput Scrolling Pixel Distance Default (350): 15
libinput High Resolution Wheel Scroll Enabled (351): 1

We’re looking for attributes that contain the keyword acceleration – use the following command to grep for those attributes:

$ xinput --list-props "TPPS/2 IBM TrackPoint" | grep -i accel
libinput Accel Speed (334): 0.300000
libinput Accel Speed Default (335): 0.000000
libinput Accel Profiles Available (336): 1, 1, 1
libinput Accel Profile Enabled (337): 1, 0, 0
libinput Accel Profile Enabled Default (338): 1, 0, 0
libinput Accel Custom Fallback Points (339): <no items>
libinput Accel Custom Fallback Step (340): 0.000000
libinput Accel Custom Motion Points (341): <no items>
libinput Accel Custom Motion Step (342): 0.000000
libinput Accel Custom Scroll Points (343): <no items>
libinput Accel Custom Scroll Step (344): 0.000000

3. Adjusting the Mouse Acceleration Using xinput –set-prop

The attribute we need to configure in order to adjust the mouse acceleration is named Accel Speed. We use the following command to adjust the setting. We can set values between 0, which means no acceleration, and 1, which means the maximum possible acceleration:

$ xinput --set-prop "TPPS/2 IBM TrackPoint" "libinput Accel Speed" 0.7

Move the mouse now to see if the change is desired. To verify the change, use the following command:

$ xinput --list-props "TPPS/2 IBM TrackPoint" | grep 'Accel Speed'
libinput Accel Speed (334): 0.700000

4. Conclusion

In this article, we tried several methods for adjusting the mouse speed and sensitivity, with only xinput working reliably on several different recent Linux distributions. By identifying and configuring the appropriate device properties, users can fine-tune their mouse acceleration settings to their preferences.

The method outlined in this guide, including listing configurable devices, identifying acceleration attributes, and setting the desired speed, ensures a reliable and customizable solution for managing mouse sensitivity through the terminal. This approach provides a straightforward and effective way to enhance user experience on Linux systems.