I want to disable middle click pasting. Preferably I would like to do it system-wide, but I am mostly concerned about disabling it in Chromium/Electron (without extensions), as I have middle click auto-scrolling enabled with --enable-blink-features=MiddleClickAutoscroll, which is annoying as it pastes every time I use my middle mouse button to scroll.
I am using KDE Plasma, and I do not want to disable middle clicking.
Solution
- Build XMousePasteBlock version 1.2: https://github.com/milaq/XMousePasteBlock/releases/tag/1.2
make allmake install
The latest (1.3) currently has an issue (https://github.com/milaq/XMousePasteBlock/issues/16) that makes it seemingly not work.
You can confirm it is installed and in $PATH with which xmousepasteblock.
- Check if
~/.config/klipperrc exists. If so, skip to the next step. If not, right click on the clipboard icon in the system tray and select configure clipboard. Change any setting (the easiest would be to change the history size) and click Apply & OK. - Edit
~/.config/klipperrcwith your preferred editor. Under[General], add this:NoEmptyClipboard=false - Open the system settings program and navigate to the 'Startup and Shutdown' option, and then select the 'Autostart' section.
- Add -> Add Application -> (path to XMousePasteBlock here, like
/usr/bin/xmousepasteblock) - Reboot or log in and out (I would prefer to reboot just to make sure)
- Confirm that the process is running with
ps aux | grep -i (PATH TO XMOUSEBLOCK)
Note: Only tested on KDE Plasma. Credit to https://github.com/milaq/XMousePasteBlock/issues/17#issuecomment-1371784589 for most of the solution. Also, setting the clipboard history size too low seemingly causes issues, so I set it to 5.
