Skip to content

Instantly share code, notes, and snippets.

@sam0x17
Last active July 30, 2023 18:17
Show Gist options
  • Save sam0x17/f1d89df55778e4317d8974623a62e8c6 to your computer and use it in GitHub Desktop.
Save sam0x17/f1d89df55778e4317d8974623a62e8c6 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

@ajayyy
Copy link

ajayyy commented Jul 30, 2023

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