Change Scroll Speed on Linux
This works if your scroll speed is too fast or too slow. For me, it works on Ubuntu (all flavours) 22.04 but does take a few minutes to do, but its worth it. Saw it somewhere before and works for me everytime i need to do it, so can't take credit for it, but can't remember where it was. Controls scroll speed system wide, not just browser, and its what linux is all about isnt it, command line to make the system do what you want. Anyway follow it step by step and it'll work for you, but its trial and error to which speed setting works best for you.
I've taken screenshots of my cmd line so you can follow easily, but as i'm a new sign up, it says I can't post images here until I've got 10 reputation. While I wait for that, there should be links under each step (or end of post) to see the screenshot.
Step 1
Open terminal - ctrl + alt + T
When terminal opens, run command to install ‘libinput-tools’ package in case you don’t have it:
sudo apt install libinput-tools
Step 1 screenshot
Step 2
Run command to get your touchpad size:
sudo libinput measure touchpad-size 100x100
You'll need to take the measurements it gives for your kernel specified touchpad size, in my case, 93.9x66.6mm (Img 2, WxH). Round your number up/down, so its a whole number and not decimals. At this stage, we only need the dimensions, DO NOT do the touchpad axis finder, do not move your finger along the touchpad yet.
Ctrl + C to exit.
Step 2 screenshot
Step 3
Next we need to figure out what speed we want, so multiply your dimensions by the number you want, for example i set mine to 0.5x scroll speed, 94 x 0.5 = 47 & 66 x 0.5 = 33, so its 47x33.
Obviously i just divided the numbers in half to get 0.5 of the value, but the above is an example in case anyone wants 0.6, 0.7 etc, this also works in the opposite direction, if you want faster scroll, you can multiply by more than 1, eg 94 x 1.3. also in the screenshot below, i'm aware i put in 48 instead of 47, apologies
So we re run the command in step 2, but replace the 100x100 with your calculated dimensions, in my case its:
sudo libinput measure touchpad-size 47x33
Run the command, and now you can follow the terminal output to “Move one finger along all edges of the touchpad until the detected axis range stops changing.“
Step 3 screenshot
When finished and the axis stops changing, press Ctrl + C to finish that, and it will give us the output needed for the config file.
Step 4
After you press Ctrl + C after axis change, you'll see the following output:
Step 4 screenshot
You need to copy between both <8----------------
(Grey background in screenshot above, ive put a red box around it)
Step 5
Run the following command to open and edit config file
sudo nano /etc/udev/hwdb.d/61-evdev-local.hwdb
Paste in the lines you copied in step 4, then press Ctrl + X to save and exit.
Step 5 Screenshot
Step 6
In terminal, update the hardware database by running following command:
sudo systemd-hwdb update
Run following command to reload udev rules:
sudo udevadm trigger /dev/input/event*
Step 6 Screenshot
Thats it! Now you need to reboot for it to take effect. There's a very good chance this will also slow down your pointer speed, but you just need to go to “Settings -> Mouse & Touchpad” and adjust ‘Touchpad Speed’ slider to your liking.
(If it doesn't slide properly, choose on the slider line where you want it to be, hover your mouse pointer there and double click)
If you want to remove the speed you've set, and reset it back to defaults
Step 1
Open terminal, Ctrl + Alt + T, and run this command to delete the config file
sudo rm /etc/udev/hwdb.d/61-evdev-local.hwdb
Step 2
Then update database and reload udev rules by running 2 commands after the other
sudo systemd-hwdb update
then
sudo udevadm trigger /dev/input/event*
And finally, restart your computer to take effect.
It may seem a little long here, but its only because i've tried to explain it as best as i can, its actually quite easy to do, so don't be afraid, it may seem daunting, but its very easy.
Best of luck!