Fix Scrolling Speed and back/forward buttons on a Logitech G900 (should be the same for this one):
xev
didn’t work for my mouse, I used the command xinput
to find out the device ID of my mouse first. To list the Input devices:
# xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech Gaming Mouse G900 id=8 [slave pointer (2)]
⎜ ↳ Logitech Gaming Mouse G900 id=9 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ Power Button id=7 [slave keyboard (3)]
↳ HD Pro Webcam C920 id=11 [slave keyboard (3)]
↳ Logitech Gaming Mouse G900 id=12 [slave keyboard (3)]
↳ Apple Inc. Magic Keyboard with Numeric Keypad id=10 [slave keyboard (3)]
and then use xinput test 8
(this is the mouse id, 9 didn't give any output) to find out that the side buttons are actually button 8 and 9 (just press them and look at the output to see which buttons you press).
I have previously installed imwheel to adjust mouse scrolling speed already
Create a .imwheelrc like this:
cat >~/.imwheelrc<<EOF
".*"
None, Up, Button4, 5
None, Down, Button5, 5
None, Thumb1, Alt_L|Left
None, Thumb2, Alt_L|Right
EOF
Where the ".*"
means, use that config for all x-windows. If you want to use that config only in chrome, for example, you could insert there "^google-chrome$"
.
You can use xprop WM_CLASS | grep -o '"[^"]*"' | head -n 1
and then click a windows, to get the Name which should be in the config.
The None
part in the first column means Mouse button klicks are registered without holding any modifier keys (e.g. Shift, Ctrl, Alt) at the same time.
Button4 and Button5 are typically the Mousewheel.
The 5
at the end of the line defines the scroll speed (higher is faster, lower is slower)
I have no idea what the ThumbN
means.
The Alt_L|Left
should emulate holding down the left Alt key (Alt_L), and pressing the left arrow (←) key to go back in the browser. KP_Left instead of Left would also work.
Restart imwheel with killall imwheel
and imwheel
.
Note: you have to reopen the windows to take effect.
To find the Button Names use the listing by xmodmap -pke
or the Graphical interface from it xkeycaps
I used many sources. To honor some of them:
Another post on same topic
Also about mouses
example imwheelrc file