I don't like the default functionality of the mouse's scroll wheel click doing a "paste". I can change that by doing the follwing:

$ xinput set-button-map 12 1 0 3 4 5 6 7

This works fine, but if I reboot, I have to remember to do it again.

My question is how can I make this happen automatically if I need to reboot, etc?

I'm using Ubuntu 12.04

You can either run the command at every login or you can put it in the X.org configuration like this:

Section "InputDevice"
    Identifier     "Logitech USB-PS/2 Optical Mouse"
    Driver         "evdev"
    Option         "Device" "/dev/input/by-id/usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse"
    Option         "ButtonMapping" "12 1 0 3 4 5 6 7"

I don't know the identifiers and driver options of your device, but you get those with xinput and by sniffing around in /dev/input.

You have to add that line in your .xsessionrc file. To do this, use the following command:

echo "xinput set-button-map 12 1 0 3 4 5 6 7" >> ~/.xsessionrc

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.