Speeding Up the Mouse Wheel

Speeding Up the Mouse Wheel

Scrolling with my mouse was too slow. That is when I came across imwheel in the Arch Wiki.

This little program lets you configure buttons and virtual buttons, such as the mouse wheel, differently for different open programs. For example, you can set a different speed in the browser than in the file manager.

For now, I have configured everything the same way. The program can be started at login through systemd at the user level.

My ~/.config/systemd/user/imwheel.service looks like this:

[Unit]
Description=IMWheel
Wants=display-manager.service
After=display-manager.service

[Service]
Type=simple
Environment=XAUTHORITY=%h/.Xauthority
ExecStart=/usr/bin/imwheel -d -b 45
ExecStop=/usr/bin/pkill imwheel
RemainAfterExit=yes

[Install]
WantedBy=graphical-session.target

Note the "-b 45" parameter, which tells the program to handle only buttons 4 and 5 of my Logitech M590 mouse. If I do not do that, the forward and back buttons stop working.

You also need the actual configuration. Put that in the ~/.imwheelrc file.

".*"
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

The last digit of the first and second lines sets the speed. The number is the acceleration factor.

1 = Default speed
3 = Triple speed

The following lines are also interesting: they allow "Ctrl + mouse wheel" to increase or decrease text size or zoom in an application. This is particularly useful to me in my development environment for enlarging text for colleagues during screen sharing.

Now just register and start the service.

systemctl --user daemon-reload
systemctl --user enable --now imwheel