Skip to content

Instantly share code, notes, and snippets.

@arthurcgusmao
Last active March 25, 2018 22:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthurcgusmao/be462687e543835a5c2fdc43e0a5eb54 to your computer and use it in GitHub Desktop.
Save arthurcgusmao/be462687e543835a5c2fdc43e0a5eb54 to your computer and use it in GitHub Desktop.
Configure middle button scroll for mouse when it's plugged in

Configure mouse's middle button scroll

This gist specifies how to setup the system to allow for mouse scrolling whenever the mouse (USB device) is plugged in.

Obs: it's not working. For some reason the script doesn't find xorg when trying to run when to mouse is plugged in, so the commands are not being applied. However, if they are called by a script after login and your mouse is already plugged in it will work.

References

#!/bin/bash
# configure mouse's middle button to be used to scroll
# (see https://askubuntu.com/a/868173/523415)
xinput --set-prop 17 'Evdev Wheel Emulation' 1
xinput --set-prop 17 'Evdev Wheel Emulation Button' 2
xinput --set-prop 17 'Evdev Wheel Emulation Axes' 6 7 4 5
# place this file in /etc/udev/rules.d/
ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c52b", RUN+="/home/arthurcgusmao/.shell_scripts/config_mouse_middle_scroll.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment