How to control the mouse scroll speed with the imwheel program

botond published 2018/11/03, Sat - 10:25 time

Content

 

Introductory

Sometimes you may need to slow down or speed up your mouse scrolling speed, or you may want to fine-tune the speed at which your mouse scrolls in different programs. In this description, you can see the setting options for this.

 

 

Installation

Az imwheel program is not part of the base system, so we need to install it as root:

apt-get install imwheel

 

Beállítások

Create a configuration file

You must first create a configuration file for the program. We have to do this as a regular user in our own directory, because we want to set the mouse in our own desktop session. You can use eg dwarf editor, or any graphic editor:

nano ~/.imwheelrc

Default

By default, include the following lines:

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

Here, the first line indicates to the imwheel that the subsequent setting block is valid for all applications. So this is a general setting to start experimenting with.

The next two lines define the smooth scrolling up and down, and the 3 numbers at the end of the lines determine how many lines to scroll, for example, in a browser.

The subsequent rows control the CTRL + up / down scroll left and the SHIFT + up / down scroll left. These can be used for example to control the magnification in a particular program, etc.

Save the file, and then run the program --kill switch:

imwheel --kill

The --kill switch ensures that when you run the imwheel program, it fires any previous copy of the program so that only one can run at a time. Without the switch, additional instances of the program will be launched, which will not result in proper operation.

Switch to custom application

The program also provides the ability to switch to custom applications, which means that we can customize the speed at which the mouse scroll speeds can operate from one program to another.

To set this up, you need the window name class of the program, which can be read with the following command:

xprop WM_CLASS | grep -o '"[^"]*"' | head -n 1

When you execute this command, the mouse cursor in our desktop environment switches to a cross mark waiting to click on a window. When this happens, the command outputs the window name as an output.

For example, by clicking on the Chrome browser window,

"google-chrome"

Then, for example, you only need to put the following in the above config file:

"^google-chrome$"
None,      Up,   Button4, 8
None,      Down, Button5, 8

Let's run:

imwheel --kill

This will allow the Chrome browser to scroll much faster while remaining in the other windows.

And similarly, we can set scrolling speeds for other programs we need.

 

Interesting Facts

Smaller things I found while using the program are that if a custom-set scroll speed window is not in the foreground, it will scroll with the scrolling speed of the application window in the foreground. For example, there is a terminal window in front of the browser, but while scrolling the back of the browser, etc.

Also, I have a VirtualBox the keyboard capture method gets stuck with the imwheel program by default, so I had to play a bit with the different key combinations to, for example, be able to use the VirtualBoxon a Win7 system running Photoshop ALT + scroll function to use zoom in/out.

Nonetheless, this small program may come in handy, in some cases, for example, when we need to scroll large log files often in the terminal. In this case, it is useful to speed up the mouse scrolling.

 

Related Content, Useful Links: