One of the most annoying features of linux is the Primary selection having paste bound to middle click. What this means is if you middle click it will paste whatever the last thing you selected was.

So if you are doing a lot of documentation or code you will have all kinds of junk pasted all over the place.

There isn’t really a good solution to the problem either as there is no config options in xorg to turn it off and most guides I found on the internet tell you to disable the button completely. I still wanted to use the middle click in browsers to open new tabs so that was a no go.

The best work around I have found is this tool XMousePasteBlock. Which sits in the background and will empty the primary selection if it gets data added to it preventing middle click inserting junk and lets programs still use it for other purposes.

You can either build it from source or if you are running an arch based distro install it via yay (or your aur helper of choice).

$ yay -S xmousepasteblock-git