DEV Community

Dutchskull
Dutchskull

Posted on

Adjusting Scroll Speed on Linux: A Quick Guide

I had been looking for how to configure this for a while, and then came by this original post. Down here there is a very concise version of the same thing.

If you find your scroll speed too fast or too slow on Ubuntu 22.04, you can easily adjust it using the command line. Here’s a step-by-step guide to help you customize your touchpad scroll speed system-wide.

Step 1: Install Required Tools

Open your terminal (Ctrl + Alt + T) and install the libinput-tools package:

sudo apt install libinput-tools
Enter fullscreen mode Exit fullscreen mode

Step 2: Measure Touchpad Size

Run the following command to get your touchpad dimensions:

sudo libinput measure touchpad-size 100x100
Enter fullscreen mode Exit fullscreen mode

Note the dimensions (e.g., 93.9x66.6mm) and round them to whole numbers.

Step 3: Calculate Desired Scroll Speed

Decide your desired scroll speed (e.g., 0.5 for half speed). Multiply your dimensions by this factor:

  • For example, 94 x 0.5 = 47 and 66 x 0.5 = 33. Run the command again with your new dimensions:
sudo libinput measure touchpad-size 47x33
Enter fullscreen mode Exit fullscreen mode

Follow the terminal instructions to complete the measurement.

Step 4: Copy Output

After finishing the measurement, copy the output between the lines marked with -<8----------------.

Example

-8<--------------------------
# Laptop model description (e.g. Lenovo X1 Carbon 5th)
evdev:name:DLL07BE:01 06CB:7A13 Touchpad:dmi:*svnDellInc.:*pnXPS159560**
 EVDEV_ABS_00=::16
 EVDEV_ABS_01=::21
 EVDEV_ABS_35=::16
 EVDEV_ABS_36=::21
-8<--------------------------

Enter fullscreen mode Exit fullscreen mode

Step 5: Edit Configuration File

Open the configuration file:

sudo nano /etc/udev/hwdb.d/61-evdev-local.hwdb
Enter fullscreen mode Exit fullscreen mode

Paste the copied lines, then save and exit (Ctrl + X).

Step 6: Update and Reload

Update the hardware database and reload udev rules:

sudo systemd-hwdb update
sudo udevadm trigger /dev/input/event*
Enter fullscreen mode Exit fullscreen mode

Final Step: Reboot

Restart your computer for the changes to take effect. Adjust the touchpad speed in “Settings -> Mouse & Touchpad” if needed.

Resetting to Default

To revert to default settings, delete the config file:

sudo rm /etc/udev/hwdb.d/61-evdev-local.hwdb
Enter fullscreen mode Exit fullscreen mode

Then update and reload as before, followed by a restart.

This process may seem lengthy, but it’s straightforward and allows you to tailor your Linux experience to your preferences. Happy scrolling!

Top comments (0)