Install packages:
sudo apt-get install xbindkeys xsel xdotool
Create xbindkey configuration file:
# ~/.xbindkeysrc
"echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys"
b:2 + Release
Set xbindkeys to load on startup:
# ~/.bashrc
xbindkeys -p
Log out, log back in, and you should be all set. If you are impatient, simply run xbindkeys -p
I've been looking for a way to do this for so long, and this is almost perfect; however it still has issues. The problem is it messes with the other functionality of middle click. Usually i would just ignore this as another "solution" that just disables the middle click entirely, but it doesn't. It seems to have a very slight chance that a middle click input will go through without pasting. I've been able to use the middle click after sever seconds to several minutes of spamming the middle click, but haven't gotten a single paste in similar amount of spam. I'm new to linux and don't have the requisite skills to troubleshoot this myself, but it's so close to finally fixing an issue that's been making me really consider switching back to Windows.
I'm running Linux Mint 20.2 Cinnamon.