DEV Community

Cover image for Ubuntu 20.04 mouse scroll wheel speed
Bavouzet Benoît
Bavouzet Benoît

Posted on • Updated on

Ubuntu 20.04 mouse scroll wheel speed

Ubuntu 20.04 mouse scroll wheel speed


I had a very slow scroll speed until I found that.

Install and run

  1. You have to install imwhell with :

    sudo apt install imwheel
    
  2. And download this bash script on http://www.nicknorton.net (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
    
  3. Then set up the .sh file to executable with :

    chmod +x mousewheel.sh
    
  4. And then run script with :

    ./mousewheel.sh
    
  5. And set your mouse wheel speed in the popup by clicking on apply button. (my setting is 7) Re-run script for change.

  6. 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"
Enter fullscreen mode Exit fullscreen mode

You can found others details here for setting speed by app :

Or in the man page : man imwheel

Image : Pexels

Sorry, it's my first post.
Have a nice day !

Oldest comments (63)

Collapse
 
hectormca profile image
Héctor Macías

That was really useful, thank you!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You are welcome, thanks to you !

Collapse
 
vinimachadosantana profile image
Vinícius Machado Araújo Santana

Awesome, bro!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Thank you 🙂 👍

Collapse
 
ghostman80 profile image
Jared Johnson

I just wanted to let you know this worked! Thank you!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

😊👍
Thanks you too

Collapse
 
pedrokuper profile image
Pedro

thank you!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Thank you too 👍

Collapse
 
rahulpa38 profile image
Rahul

My back button stopped working on my mouse

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Try to use imwheel -b "4 5"

Collapse
 
dilantha111 profile image
Dilantha

wow this was really helpful !!! Thank you so much !!!!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You are welcome 🙂 thank kou 👍

Collapse
 
caleb15 profile image
Caleb Collins-Parks

For those wondering how to do step 6 see io.bikegremlin.com/11541/linux-mou...

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Thank you for your link 👍

Collapse
 
monishwankhade10 profile image
monishwankhade10

thanks man

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You're welcome

Collapse
 
middienomad profile image
middieNomad

Thanks mate, this worked like a charm.

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You are welcome, thanks to you and dev.to 😊

Collapse
 
viveknath322 profile image
Vivek Nath.R • Edited

Hi,

When I run step 4, I'm getting this "This option is not available. Please see --help for all possible usages."

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Sorry, have you downloaded script on step 2 ? Or copy and past ?

Collapse
 
hoangphucitjp profile image
Kyouko__O

I got same issue. Both copy&paste and download the script produce same issue

Collapse
 
jasminemoreira profile image
Jasmine Moreira

Thank you a lot!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You are welcome 😉👍

Collapse
 
younessdotcom profile image
Youness Hassani

it works !!!! thank you so much

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You're welcome 👍😉

Collapse
 
bogdevil13 profile image
bogdevil13

Just one thing, this is not limited to Gnome only as is commented on the top of the script, imwheel works at X windows level. It worked for me on KDE.

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Thanks for your comment ! 😀👍

Collapse
 
charcoalabbys profile image
charcoalAbbys

Thanks a lot :)

Collapse
 
bbavouzet profile image
Bavouzet Benoît

You are welcome 😀👍

Collapse
 
alfmateos profile image
alfmateos

Thanks a lot, you solved my problem!

Collapse
 
bbavouzet profile image
Bavouzet Benoît

Thank you to dev.to community 😀
Have fun