Skip to content

Instantly share code, notes, and snippets.

@alexandresalome
Created February 4, 2015 11:25
Show Gist options
  • Save alexandresalome/4b70f2a4a1b8a7b2d61a to your computer and use it in GitHub Desktop.
Save alexandresalome/4b70f2a4a1b8a7b2d61a to your computer and use it in GitHub Desktop.
Edit your clipboard
#!/bin/bash
#
# Clipboard Editor - edit your clipboard in your favorite editor
set -e
# xclip command to execute
XCLIP_COMMAND="xclip -sel clipboard" # works on Xubuntu
# editor to use
EDITOR="subl -w -n" # sublime text
TMP_FILE="/tmp/clipboard-editor"
$XCLIP_COMMAND -o > "$TMP_FILE"
$EDITOR "$TMP_FILE"
$XCLIP_COMMAND -i "$TMP_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment