Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save scissorsneedfoodtoo/539dbbd01ebfd36fd8a671124d290f5a to your computer and use it in GitHub Desktop.
Save scissorsneedfoodtoo/539dbbd01ebfd36fd8a671124d290f5a to your computer and use it in GitHub Desktop.
disable middle-click paste in linux without disabling middle scroll

Disable middle-click paste in Linux

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment