Skip to content

Instantly share code, notes, and snippets.

@miestasmia
Last active May 14, 2016 11:10
Show Gist options
  • Save miestasmia/56718c26964735d021802eca753f9b1f to your computer and use it in GitHub Desktop.
Save miestasmia/56718c26964735d021802eca753f9b1f to your computer and use it in GitHub Desktop.
Pastes clipboard without formatting. Assign to a hotkey. GNU/Linux only
#!/usr/bin/env python2
import pyperclip, subprocess
copy = pyperclip.paste().decode('utf-8') # Automatically removes formatting
for char in copy:
n = hex(ord(char))[2:]
subprocess.call(["xdotool", "key", "U" + n])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment