Ubuntu 20.04 mouse scroll wheel speed
I had a very slow scroll speed until I found that.
Install and run
-
You have to install imwhell with :
sudo apt install imwheel
2. And download this bash script on [http://www.nicknorton.net](http://www.nicknorton.net/mousewheel.sh) (thanks to him)
You can type, as @victoor say in comments :
>You can just do ` bash <(curl -s http://www.nicknorton.net/mousewheel.sh) ` instead of copy the script manually and changing permissions. :)
```
#!/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
- Then set up the .sh file to executable with : ```
chmod +x mousewheel.sh
4. And then run script with :
```
./mousewheel.sh
And set your mouse wheel speed in the popup by clicking on apply button. (my setting is 7) Re-run script for change.
Finally add imwheel in ubuntu startup application.
If you have troubleshooting with previous and next mouse buttons :
- Add
-b "4 5"
to imwhell :
imwheel -b "4 5"
You can found others details here for setting speed by app :
Fixing Mouse Wheel on Chrome in Ubuntu 18.04 Virtualbox / VMWare
Dan Voyce ・ Jul 23 '19
Or in the man page : man imwheel
Image : Pexels
Sorry, it's my first post.
Have a nice day !
Top comments (63)
Speed 7 👍
This happened for me when I added some monitors and "Put Windows" to my setup.
Not sure whose exact fault it is in the end.
The solution works well, although the scrolling is not as smooth as I'm used to, but much better than before.
Thanks a bunch! 💚
OK, just turned it down to 3 😬
Ok, thank you for your comment 😀😉🙏
If I try to run the script, it says "Value out of range.".
If I run "bash <(curl -s nicknorton.net/mousewheel.sh)" as superuser then I see the windows to adjust the speed and it works fine.
Adding it to the startup doesn't help... each time I have to run it as root.
What am I doing wrong?
Using this on Kubuntu 20.04.1 LTS and Thinkpad L380
nevermind, deleting ~/.imwheelrc and re-running the script fixed it.
Ok 👍😊
You can just do
bash <(curl -s http://www.nicknorton.net/mousewheel.sh)
instead of copy the script manually and changing permissions. :)Ok, good tip ! I will add this to post ;)
Many thanks !
Thanks a lot, you solved my problem!
Thank you to dev.to community 😀
Have fun
Your script doesn't work for me.
Here are my revised lines that made the script work for me (line numbers included):
FYI the changes are: added grep to return the numbers only and put an equals sign in the --text option for zenity.
Thanks mate, this worked like a charm.
You are welcome, thanks to you and dev.to 😊
A couple of other options are listed here: askubuntu.com/questions/285689/inc...
I implemented an own simple Python script which you can simply run in the background, which implements mouse scroll wheel acceleration: github.com/albertz/mouse-scroll-wh...
Hi,
When I run step 4, I'm getting this "This option is not available. Please see --help for all possible usages."
Sorry, have you downloaded script on step 2 ? Or copy and past ?
I got same issue. Both copy&paste and download the script produce same issue
Worked flawlessly in ubuntu 18 !
Cool ! 👍
Have a nice day !
For those wondering how to do step 6 see io.bikegremlin.com/11541/linux-mou...
Thank you for your link 👍