How to update Ubuntu scroll speed

avatar

Borislav Hadzhiev

Thu Feb 11 20212 min read

banner

Photo by Artem Maltsev

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:

shell
touch ~/.imwheelrc vim ~/.imwheelrc

And paste the following config in:

~/.imwheelrc
"^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:

shell
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:

shell
sudo apt install imwheel

Now start imwheel:

shlel
imwheel -b "4 5"

If imwheel was already running on your machine you might have to stop the process before starting it:

shell
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:

shell
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

~/.imwheelrc
".*" 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

Add me on LinkedIn

I'm a Web Developer with TypeScript, React.js, Node.js and AWS experience.

Let's connect on LinkedIn

Join my newsletter

I'll send you 1 email a week with links to all of the articles I've written that week

Buy Me A Coffee