Skip to content

Instantly share code, notes, and snippets.

@waldyrious
Last active November 13, 2017 18:55
Show Gist options
  • Save waldyrious/d804fd283548bbded1b5750e25974ca6 to your computer and use it in GitHub Desktop.
Save waldyrious/d804fd283548bbded1b5750e25974ca6 to your computer and use it in GitHub Desktop.
Disable mouse middle click paste in Linux

Script from the 2012 blog post How to Disable Mouse Middle Click to Paste Feature in Linux, which links to a now dead Dropbox url. Fortunately, Archive.org's Wayback Machine managed to capture one(!) snapshot of the script before it went down. So here it is, for posterity:

#!/bin/bash

while(true)
do
    echo -n | xsel -n -i
    sleep 0.5
done

Attention: this script will continually clear the X selection area, which means you won't be able to select text on a terminal to copy it elsewhere.

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