I'm looking for a way to permanently disable middle mouse click on my Ubuntu 18.
In this post, @Yehosef kindly gives this solution to disable middle click:
xinput list #to find mouse id
xinput set-button-map [mouse id] 1 0 3
but I need to type it each time I restart my computer.
Is there a way to make it persistent?
Best Answer
This is what I do on Ubuntu 20.04 (uses Wayland by default) to disable my middle button or remap my middle button.
To find my device id:
I had to do a couple test before I found the right id. For me, it was 6.
To see current button map:
To disable middle button:
To remap middle button to left click:
In order to run at startup, create a file and make sure it's executable (chmod a+x):
Ubuntu and other GNOME based distributions come with an application simply called “Startup Applications”. It can be used for managing apps and scripts that run on a fresh system reboot or login. So just do a search for it, open it and add the file you just created.