Mouse Wheel Speed in Linux

If you have installed kubuntu, you won’t find a setting to change the speed of the mouse wheel. So you have to install it.

I found this cool tutorial that helped me with that : tutorial

  • First we have to install these two apps :
sudo apt install imwheel zenity
  • Then we have to create a new file containing the script to run a window to change the speed setting of the mouse wheel : (you may choose a good location for this file, for example /home/tools)
sudo nano mousewheel.sh
  • Insert this code in it :
#!/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
  • Or you can grab it directly using :
curl -s http://www.nicknorton.net/mousewheel.sh > mousewheel.sh
  • Make it executable :
chmod +x mousewheel.sh
  • Run it :
./mousewheel.sh
  • I have set it to 2 since higher values made the scrolling too fast.

Copyright

Comments