Borislav Hadzhiev
Last updated: Feb 11, 2021
Check out my new book
It is very strange that you are not provided a default GUI to update scroll speed on Ubuntu, it's one of the more obvious configuration options that are missing.
We're going to use imwheel
to adjust the scroll speed of different
applications.
First create the config file:
touch ~/.imwheelrc vim ~/.imwheelrc
And paste the following config in:
"^google-chrome$" None, Up, Button4, 4 None, Down, Button5, 4 Shift_L, Up, Shift_L|Button4, 4 Shift_L, Down, Shift_L|Button5, 4 Control_L, Up, Control_L|Button4 Control_L, Down, Control_L|Button5
The `"^google-chrome$" part is the application for which we want to update the scroll speed. In order to get the name of an application you have to enter a bash command:
xprop WM_CLASS | grep -o '"[^"]*"' | head -n 1
And then click on the application, the name will be displayed in your terminal.
In the above configuration Button4
is scrolling up and Button5
is
scrolling down.
To change the scroll speed, edit the number after the comma on the lines
starting with None
, in our case it is 4 for both scrolling up and scrolling
down.
Save the configuration file and install imwheel
:
sudo apt install imwheel
Now start imwheel
:
imwheel -b "4 5"
If imwheel was already running on your machine you might have to stop the process before starting it:
killall imwheel imwheel -b "4 5"
The reason we pass in the -b "4 5"
flag is we only want to target specific
buttons on the mouse, otherwise it blocks your mouse's side buttons (back,
forth, etc).
Every time you edit your ~/.imwheelrc
you have to rerun the commands:
killall imwheel imwheel -b "4 5"
If you don't want fine grained control with different scroll speed for different applications you could set the scroll speed for all applications, with config similar to this
".*" None, Up, Button4, 4 None, Down, Button5, 4 Shift_L, Up, Shift_L|Button4, 4 Shift_L, Down, Shift_L|Button5, 4 Control_L, Up, Control_L|Button4 Control_L, Down, Control_L|Button5