mrichar1/clipster

disable middle mouse button as paste

lilibyte opened this issue · 2 comments

Prior to installing clipster I've been using xbindkeys, xsel, and xdotool to disable the middle mouse button paste functionality:

(~/.xbindkeysrc config file)
"echo -n | xsel -n -i; pkill xbindkeys; xdotool click 2; xbindkeys"
b:2 + Release

The reasoning is that often selections will include newlines that when pasted into a terminal, or more importantly: a terminal-based chat program, are interpreted as entering to send a message per newline. I view this as a concerning security risk, especially on a ThinkPad with a prominent middle click button, so I'm sad this hack stopped working after running clipster.

Is an option for this within the scope of clipster, or do you have any advice for a way around this?

I'm just thinking on how to do this from clipster - I suspect the easiest option would be to have clipster notice any updates to the selection clipboard and just empty or override the clipboard contents at that point. This means you could only use the clipboard board for copying and pasting. I think it would be relatively easy to implement this, but I'd need to review the code as it's a while since I dug into the actual selection mechanisms. Obviously this could potentially be a little racey, as you could paste before clipster had cleared the board, but it's probably not any worse than our previous workaround.

The only other alternative would be to disable/remap the middle button, but then it wouldn't be useable for anything, which probably isn't what you want!

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.