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

2 Answers 2


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

You can either run the command at every login or you can put it in the X.org configuration (/etc/X11/xorg.conf) 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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