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:
If you have any questions (or additions and corrections), please use the BikeGremlin forum:
www.bikegremlin.net
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.

Picture 1

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

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

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 “mouse.sh” – 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:
#!/bin/bash
# Version 0.1 Tuesday, 07 May 2013
# Comments and complaints http://www.nicknorton.net
# 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 ]
then
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
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
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
Update:
WordPress’s front end messes up the code, replacing two “minus signs” with a long dash. So, I’ve made a simple downloadable mouse-sh.zip file if it helps:
https://files.bikegremlin.com/downloads/mouse-sh.zip
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 mouse.sh
./mouse.sh
Here’s how it looks like on screen, you’ll get to set mouse scroll speed:

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

Picture 6
If you aren’t happy with the newly set mouse scroll speed, just run the “mouse.sh” again, as expained in picture 5.
Help BikeGremlin
stay online & independent
This website is educational, free, objective, and not commercial
(sponsors don’t enjoy paying if you mention all the product downsides that you notice 🙂 ).
If you find this site to be good and helpful,
and if $5 per month is what you can afford to set aside,
please consider supporting my work with a Patreon donation:
3. Configuring Imwheel to run after each restart
For this I used “Startup Applications”.

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

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

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.
Troubleshooting
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
If you have any questions (or additions and corrections), please use the BikeGremlin forum:
www.bikegremlin.net
No NO NO
This is microsoft bullshit. I don’t need to install ANYTHING to adjust settings. We need to have this setting exposed. 3rd party apps just pollute the computing environment.
Can you propose another way of doing this, or provide a link where an alternative solution is explained in a noob-friendly way?
I’d gladly pay Bill Gates 100 USD or whatever Windows 10 costs nowadays to not have to waste my time on this cryptic GNU BS. Maybe even get a Mac and practical accent input as well.
webupd8.org/2015/12/how-to-change-mouse-scroll-wheel-speed.html worked:
sudo apt-get install imwheel
gedit ~/.imwheelrc
Paste this, save, and close gedit:
“.*”
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
imwheel –kill –buttons “4 5”
Add previous command to autostarts (maybe ~/.bashrc).
Compose key works in X11 (not Wayland!). Tested in KDE of kubuntu-desktop on Ubuntu 19.10. Enable via advanced keyboard settings.
It’s not “GNU BS” – it’s a choice. You choose and use what’s right for you – no-one is trying to take that away from you. Personally, I choose freedom, as I strongly believe the little quirks and a few “rough edges” here and there are well worth it.
On a side-note, I have built a very successful career on Linux, so I donate back much more than $100 – every single year 🙂 Linux works for me, but it sounds like it rubs you up the wrong way.
“chromium” instead of “.*” to only affect Chromium and avoid turning 5 to 17 line scroll in GNOME Terminal 3.36.2.
Linux Mint Cinnamon is my favorite OS at the moment, as i couldn’t even log into Windows 10 on a brand new HP Envy using my work email, and MacOS requires an Apple ID to update preinstalled software. Then again, Firefox caused the entire system to lag, but i’m not sure whether that also occurs on Windows as i switched to Chrome there as well and added my OOM Killer to avoid thrashing. Maybe Minix is the only truly reliable OS.
This worked perfectly. Thank you for the tutorial.
Worked great! Thanks a lot! 🙂
Thank you all for the feedback. Glad it has helped. 🙂
thx a lot, your script solved my problem too! 🙂
Worked wonderfully. Thank you 🙂
Thanks a lot. It worked perfectly for me. The slow scroll speed was driving me nuts…
Thanks, you rock. I’ll never understand why Ubuntu doesn’t have on option to change the scroll speed.
Thank you so much!
Why Ubuntu still doesn’t offer an option to adjust this by default is beyond my comprehension.
But I’m having a minor issue: everything was fine until I realized that now my “back” and “forward” buttons aren’t working and I think the script somehow has blocked this function. They were working normally for web pages and Dolphin navigation before. Do you have any clue on what might have happened?
No. I haven’t had any problems with the “extra” mouse buttons functioning.
It’s ok. I’ve just found out what was happening
There’s already an issue addressed here: https://askubuntu.com/questions/421645/imwheel-destroys-back-forth-navigation-buttons-from-my-mouse
For those running into the same problem, just replace the last line of the script with the following:
imwheel -k -b “4 5”
Save the file, run the script with “sudo” command and you’re good to go!
Cool. Thanks for the feedback. 🙂
Added this to the original text, so it can help anyone else with a similar problem.
Nice, it works even in Gnome running over Wayland, one just need to use a toggle before the command to make sure it can display the dialog window in Xwayland:
XDG_BACKEND=x11 ./mouse.sh
And just to clarify things a bit, the mouse.sh script just need to run when you want to change the scroll speed, the settings are actually saved to ~/.imwheelrc file, and read every time the daemon starts. You just need to use “sudo imwheel -k” if you want to change the command, like when you add ‘-b “4 5″‘, after the daemon is already running to prevent a ‘ghost’ process, like it was explained in the askubuntu site.
PS: You may want to check your site service, I got a bunch of 503 errors (service not available) yesterday, and I almost gave up posting the comment…
Regards
Thank you very much for the info. 🙂
As for the website problems, I had found and “eliminated” the culprit – as explained here in more details:
https://io.bikegremlin.com/14941/seo-framework-vs-yoast/#7.2
(the part after “Update 1st May 2020”)
Please let me know if you run into any more problems.
Just a quick fix, as I cannot edit my reply: the correct environment variable to be used (XDG_BACKEND does nothing) is GDK_BACKEND=x11, this will force a program to run on Xwayland, when it is compatible with XOrg only.
Boom, it’s help me out of the terrible scroll speed in ubuntu, thank you.
Also, I have back/forth button in my mouse too, I tried imwheel -k -b “4 5” but seem it not work, not sure what wrong, is it different between each mouse?
Not sure – my mouse, for example, had no problems even without using those options.
I tried set it in startup application and seem it’s a bit different from.
As I don’t have startup delay: https://photos.app.goo.gl/qAij8zCn1TB54jKT7, is it normally?
Sorry, but I just tried switch to linux 2 weeks and I still can’t control it good as much as I want.
I had some issues too. I fix them by modifying the file /etc/X11/imwheel/startup.conf
I changed IMWHEEL_START=0 to IMWHEEL_START=1
So there’s no need to add the startup application.
On the same file, uncommented the IMWHEEL_PARAMS line and changed it to:
IMWHEEL_PARAMS=’-b “4 5″‘
that kept my other buttons working
Thank you!!!!!
Thanks, but can I add these rules only for mouse, not for the touchpad?
Not that I know – maybe others can help. If touchpad input is defined differently (button numbers, as mentioned in the Troubleshooting section), then I suppose it could be configured. But I don’t think that is the case.
Thanks a lot! This is making my life a lot easier 🙂
the imwheel’s window is opening at each login, is there an option to start and apply settings but not open windows ? – Thx anyway for the trick
I’m not having that problem.
For solving, I’d start with double checking the contents of the mouse.sh (or however it was named in this case).
If there’s a line, or something else missing.
My error.. i’ve put mouse.sh in the startup rather than iwheel… corrected, run perfectly ! 🙂
Thx
Excellent.
My system froze after the first attempt.
After a restart, it works perfectly.
Thank you!
I have two hard drives with different linux distributions. When I boot linux from disk B, the mouse scroll speed is always the same. Instead, when I start the operating system from the disk A when the last time I used a hard disk B as a mouse scroll speed is very high. When I disconnect the mouse and put it back, the mouse scroll speed returns to normal. So the problem is probably somehow on the hard drives. Operating systems don’t matter.
Can anyone tell me why this is?
If you use a logitech mouse, try installing solaar and enable wheel resolution. It will produce windows like silky smooth scrolling.
Thank You, but
I have Microsoft mouse.
Thank you, worked perfectly
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 mouse.sh 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. 🙂 )
This is perfect, it works exactly as expected, while preserving the functionality of extra buttons such as back/forward on Intellimouse Pro. Thank you!
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. 🙂
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?
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. 🙂
Is Imwheel still up-to-date?
You will find a couple of alternative options here: https://askubuntu.com/questions/285689/increase-mouse-wheel-scroll-speed/
I implemented an own small script which also supports mouse scroll wheel acceleration. It’s a simple Python script which you can just run in the background.
https://github.com/albertz/mouse-scroll-wheel-acceleration-userspace
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!
Thank you very much
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!
Thanks for the feedback, Jamie. 🙂
It worked perfect for me. Thanks for the tutorial.
Tested this on Zorin OS. Works like a charm.
Many thanks to Relja for sharing this with us!
Hi Bogdan,
You’re welcome, glad it could help. 🙂
Thanks for the feedback regarding Zorin OS distro.
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
Thanks very much for your help!
Amazing! It worked flawlessly. Thank you so much!
Okay, so this accelerated my scroll speed like crazy, and I’ve tried reducing it to 1 again, but it doesn’t fix it.