Making the xinput --set-button-map changes permanent

I put some wait time and retries into my script and lived with that for a few days, but this weekend I had some spare time to find the "correct" solution.

That is, add the button map into a config file for X.

#/usr/share/X11/xorg.conf.d/logitech-mx-revolution.conf

Section "InputClass"
    Identifier  "Logitech MX Revolution Mouse"
    Option  "ButtonMapping" "1 2 3 4 5 6 7 9 8 10 11 12 13 14 15 2 17 18 19 20 21 22 23 24"
EndSection

Hopefully this helps someone else one day.


I have a Logitech Ultrathin Touch and I got the remapping to work with:

/etc/X11/xorg.conf.d/10-evdev.conf # # custom for logitech ultrathin mouse

Section "InputDevice"
    Identifier "Logitech bluetooth Touch Mouse"
    Driver "evdev"
    Option "Name"   "Ultrathin Touch Mouse"
    Option "ButtonMapping" "1 1 3 4 5 6 7 0 0 0 0 0 0"
EndSection


Section "InputClass"
    Identifier  "Ultrathin Touch Mouse"
    Option "ButtonMapping" "1 1 3 4 5 6 7 0 0 0 0 0 0"
EndSection

Not sure if all of this is needed but after a day of wrestling with this i'm just relieved that something works... I've found now that horizontal scrolling is a little slower than i'd like. so i'll probably see if there's some option to configure that.