Nicolas Noben

Configure Mousewheel Speed on Debian/Linux Mint incl. Cinammon etc.

mousewheel speed, debian, linux, mint, cinammon

2021-11-11

Introduction

The following fixes the slow mousewheel on debian/mint using Cinammon / GTK3. install a package called imwheel and use a script that generates a small UI to tweak the setting.

Personal settings will be saved in ~/.imwheelrc.

sudo apt install imwheel

touch ~/mousewheel.sh # edit and paste the mousewheel.sh

chmod +x ~/mousewheel.sh

~/mousewheel.sh # opens a GTK UI, I found the value 4-5 to be about right

Contents of mousewheel.sh

#!/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

Please note I did’t write that script, all credits go to Nick Norton of http://www.nicknorton.net

Start at startup

For it to stick you’ll need to add imwheel to your startup applications list.

HTH.