Share

Overview

Have you ever found yourself frustrated by the mouse scroll speed on your Linux system? It’s a common annoyance. Scrolling can feel too slow, making you feel like you’re slogging through web pages or documents. Alternatively, it can be too fast, making it challenging to navigate precisely.

In this post, I’ll show you how to take control of your mouse scroll speed on Linux using a tool called imwheel.

Explaining the Problem

The scroll speed of your mouse is an essential aspect of your interaction with the system. Particularly, when it’s not set to your preferences, it can hinder productivity. For example, suppose you’re browsing a large pdf file or any other document on the web. You might feel frustrated if you can’t quickly reach to pages you want to view.

This is where imwheel comes to the rescue.

Introducing imwheel

imwheel is a Linux utility that lets you fine-tune the scroll speed of your mouse. Basically, it’s a lightweight and powerful tool. It can help you get the perfect balance between speedy navigation and precision.

Installing and Configuring imwheel

To get started, you’ll need to install imwheel. Open your terminal and then run the following command:

sudo apt install imwheel   # For Debian/Ubuntu based systems

Further, let’s create a configuration file for imwheel. Open a text editor and create a file named ~/.imwheelrc. This is where you’ll specify your scroll speed preferences:

nano ~/.imwheelrc

Here’s an example of what your ~/.imwheelrc file might look like:

".*"
None, Up, Button4, 5
None, Down, Button5, 5
Control_L, Up, Control_L|Button4
Control_L, Down, Control_L|Button5

This configuration sets the scroll speed to 5 lines per notch for both upward and downward scrolling. Also, you can adjust the 5 to your preferred value.

Running imwheel

Now that you have your configuration ready, it’s time to run imwheel with your settings. In the terminal, type:

imwheel -b "4 5"

This statement tells imwheel to use the .imwheelrc file as its standard setup file and to scroll at the speed you specify. You can now see a new process called imwheel in the system monitor application:

Furthermore, we can change the scroll speed by putting a new number in the .imwheelrc file.

The -kill option is also used to restart imwheel and apply any new settings. With this option, the older processes are killed and a new instance of imwheel is started.

You can also use imwheel in a graphics way. Let’s look into this idea.

imwheel GUI

For the graphical approach, we need to download a bash script from https://www.nicknorton.net. To simplify things, I’ve put the contents of the file (without comments) below:

".*"
None,      Up,   Button4, 1
None,      Down, Button5, 1
Control_L, Up,   Control_L|Button4
Control_L, Down, Control_L|Button5
Shift_L,   Up,   Shift_L|Button4
Shift_L,   Down, Shift_L|Button5
EOF

fi

CURRENT_VALUE=$(awk -F 'Button4,' '{print $2}' ~/.imwheelrc)

NEW_VALUE=$(zenity --scale --window-icon=info --ok-label=Apply --title="Wheelies" --text "Mouse wheel speed:" --min-value=1 --max-value=100 --value="$CURRENT_VALUE" --step 1)

if [ "$NEW_VALUE" == "" ];
then exit 0
fi


cat ~/.imwheelrc
imwheel -kill

Save the script with any name, say mousespeed.sh, and assign execute permission to it:

chmod +x mousespeed.sh

Finally, run the script:

./mosuespeed.sh

Change the speed of your mouse wheel using the slider in the pop-up window and then click “Apply.” Change the speed by running the script again.

Pinning the Changes

Adding imwheel to your startup apps will keep it running even after you restart your system. Depending on your Linux system and desktop experience, the steps you need to take may be different.

On Ubuntu, you need to simply set the desired mouse speed in the .imwheelrc file and add the following line in the startup application setup:

Summary

In conclusion, using imwheel to modify the pace at which your mouse scrolls can significantly boost your productivity.

Try it out, experiment with different settings, and find the scroll speed that suits you best.


Share