BikeGremlin search...
Start » Linux » Tweaking » Altering mouse scroll speed in Linux

Altering mouse scroll speed in Linux

I started playing with Linux, having installed Mint (Ubuntu based, which is Debian based – for more details). Linux Mint is very user friendly (unlike Linux 15 years ago), but it does have its peculiarities (especially for us coming from decades of DOS & Windows use). One of the “problems” for me was simple mouse scroll button speed change. Here’s how I fixed that.

For solving this I used Imwheel. The procedure is relatively simple and straight forward, with a few tweaks (noted in this post). It boils down to this:

1. Installing Imwheel

You can open Software Manager, search for “Imwheel”, then click “Install”, after which you will be asked to enter your root password and that’s it.

Installing Imwheel using Linux Software Manager
Installing Imwheel using Linux Software Manager
Picture 1
Authenticating the install with a root password (1), then click "Authenticate" (2)
Authenticating the install with a root password (1), then click “Authenticate” (2)
Picture 2

Of course, you could use the command prompt (CTRL+ALT+T is the keyboard shortcut, not WIN+R – note to self 🙂 ). Imwheel is installed using the following command (you will be prompted for a root password after pressing Enter):

sudo apt-get install imwheel
Command prompt installation of Imwheel
Command prompt installation of Imwheel
Picture 3

If all went well, you will see something like this:

Imwheel successfully installed
Imwheel successfully installed
Picture 4

2. Configuring Imwheel

Configuration boils down to creating a .sh file with an appropriate code, then running it. I did it the following way:

I created an “Utils” directory in my “Home” directory (that is “/home/relja/Utils”). Of course, you can put the file anywhere you want.

Then I opened a text editor, copied the needed code (found at this page – thank you) and saved it as “” – you can name it however you like, as long as you know the file name and directory where it’s saved at.

Needed file contents:

# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints
# GUI for mouse wheel speed using imwheel in Gnome
# imwheel needs to be installed for this script to work
# sudo apt-get install imwheel
# Pretty much hard wired to only use a mouse with
# left, right and wheel in the middle.
# If you have a mouse with complications or special needs,
# use the command xev to find what your wheel does.
### see if imwheel config exists, if not create it ###
if [ ! -f ~/.imwheelrc ]

cat >~/.imwheelrc<<EOF
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


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

sed -i "s/\($TARGET_KEY *Button4, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button4, and write new value.
sed -i "s/\($TARGET_KEY *Button5, *\).*/\1$NEW_VALUE/" ~/.imwheelrc # find the string Button5, and write new value.

cat ~/.imwheelrc
imwheel -kill

WordPress’s front end messes up the code, replacing two “minus signs” with a long dash. So, I’ve made a simple downloadable file if it helps:

Then, in the command prompt, go to the directory and run the file. Before running the script, you must give it the execution rights using the command “chmod +x” In my case:

cd /home/relja/Utils
chmod +x

Here’s how it looks like on screen, you’ll get to set mouse scroll speed:

Enter the three command lines (enter after each, of course) (1), select desired scroll speed (2), then click "Apply" (3)
Enter the three command lines (enter after each, of course) (1), select desired scroll speed (2), then click “Apply” (3)
Picture 5

I chose 3. After clicking at “Apply”, you’ll see something like this:

Successfully finished scroll speed configuration
Successfully finished scroll speed configuration
Picture 6

If you aren’t happy with the newly set mouse scroll speed, just run the “” again, as expained in picture 5.

How can I help BikeGremlin to remain independent and objective?

Become a patron - Support BikeGremlin on Patreon

3. Configuring Imwheel to run after each restart

For this I used “Startup Applications”.

Opening "Startup Applications"
Opening “Startup Applications”
Picture 7

On the next screen click the ” + ” sign and choose “Custom command” option.

Click the + sign and choose "Custom command"
Click the + sign and choose “Custom command”
Picture 8

The last step is shown and explained in the picture 9:

Use whatever you want for name (1) Command must say "imwheel", because that is the application (2) For comment, use whatever you like (3) Add a startup delay if you like - I set a 5 second delay (4) Finally, click "Add" (5)
Use whatever you want for name (1)
Command must say “imwheel”, because that is the application (2)
For comment, use whatever you like (3)
Add a startup delay if you like – I set a 5 second delay (4)
Finally, click “Add” (5)
Picture 9

You can try restarting the computer, to make sure mouse scroll speed is still working properly.


As Alex added in the comment section, there can be a problem with the functioning of extra mouse buttons (with some mouses that have extra buttons, in addition to the standard two and the wheel). The solution is limiting imwheel to the scroll only (wheel up: 4, and wheel down: 5). For Linux Mint, it is the following command:

imwheel -b "4 5"

“-b” is the switch that basically says “deal only with the listed buttons”. This can also be added to the command line – (2) in picture 9.

For more details (manual), type this in the command prompt:

man imwheel

59 thoughts on “Altering mouse scroll speed in Linux”

  1. This is driving me crazy. I have imwheel -b “4 5” replaced for the last line of text, but this only preserves the functionality of the back and forward buttons of my mouse if, on startup application preferences, I click browse next to the command and click on instead of just typing in imwheel as the command. But by doing this, the imwheel window for the scroll speed pops up every time I restart. There’s just no solution!

    • In this article I wrote down what has worked for me, on about 4 different computers (laptops and desktops). Step by step.
      In my experience, it is important to not miss/skip any steps written down here. That’s the first thing I do when troubleshooting – double check.
      (Well, actually, the first thing I do is look for manuals and tutorials – after all else fails. 🙂 )

  2. This is perfect, it works exactly as expected, while preserving the functionality of extra buttons such as back/forward on Intellimouse Pro. Thank you!

  3. Thank you so much for this tuto, it works like a charm! And it’s probably the clearest step by step guide I’ve seen so far. Just what I needed.

    • Wrote it so that I can easily use it at any later date – without the need for any further brain strain on my part. 🙂

  4. It doesn’t work at all. No matter what speed do I select, the response is always the same slow scrolling.

    • When facing a problem like this, here’s what I’d do to troubleshoot:
      1) Check the instructions, step by step. Did I miss, or skip something?
      2)Check if imwheel is running (even after a restart). Linux mint has a GUI for that, called “System Monitor”. Imwheel should be listed there.
      If running some other distro, or if you prefer the terminal, run the command:
      “ps axu”
      It will provide a list of all the processes. Is imwheel listed there?

  5. Thank you SO much!
    It is the little things that pile un-wanted pressure on the mind. Thank you so much for taking this load away!
    This is a super well written, fantastically supported with screen shots, etc. I am using XFCE4 and some of my windows are looking, well, more XFCE like, but it is perfect.

    I look forward to being able to use more you your help at any point – I will indeed keep watch for your name when I need a tutorial for some Linux aspect.

    You trully made my day 😉

    • Glad it helped. 🙂

      Though I’m far from a Linux expert. It took me quite some time to figure this out – and was pretty annoying not being able to tweak the mouse scroll speed.
      Wrote this article for easy reminder/reference, primarily to myself, for when I need it again (any new Linux install etc.). And I’d still have to rely on it to get that done. 🙂

    • Don’t know about imwheel being up-to-date, but it still works fine on several computers I had set it up on.
      Thanks for the links. 🙂

    • Still works for me in 2021, I hope this feature will be integrated in Wayland soon!

  6. Nice “how to guide” Relja!! This has been bugging me for so long. Works a treat on Ubuntu 20.04 LTS with my Logitech M525 mouse. Fastest scolling ever. I love it!

    • Hi Bogdan,

      You’re welcome, glad it could help. 🙂
      Thanks for the feedback regarding Zorin OS distro.

  7. thanks, this helped. but this is also one of the reasons why nobody sane uses Linux 😀 I need it as a dev environment and that’s it

  8. Okay, so this accelerated my scroll speed like crazy, and I’ve tried reducing it to 1 again, but it doesn’t fix it.


Leave a Comment