1 Install imwheel, info: https://packages.debian.org/wheezy/imwheel
2 Activate imwheel: as root user change /etc/X11/imwheel/startup.conf IMWHEEL_START=0 to IMWHEEL_START=1
3 Reboot computer
4 Run script below (save as mousewheel.sh and mark executable, creates /home/username/.imwheelrc config file)
...or create your own /home/username/.imwheelrc config file (user defined, man imwheel and imwheel --help)
...or alter /etc/X11/imwheel/imwheelrc (global settings for all users) to setup desired scroll rate
5 Enjoy
Code: Select all
#!/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
Code: Select all
".*"
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
http://nicknorton.net/?q=node/10
Notes:
-As noted in the script above this works primarily with a simple/standard type mouse with left/right buttons and a middle wheel
-Always do your homework and exercise caution before making system changes
-The script can be re-run as desired to further fine tune scroll rate settings
-The imwheelrc config file can be further customized to be application specific if desired (man imwheel)
-These changes are fully reversible (remove imwheel package, delete mousewheel.sh script and all imwheelrc configuration files
-Unless your pores sweat geek, the script method is much easier than creating your own imwheelrc file
mardybear