Skip to content

Instantly share code, notes, and snippets.

@alexandresalome
Created December 7, 2014 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexandresalome/1460a7215e2528cc8d12 to your computer and use it in GitHub Desktop.
Save alexandresalome/1460a7215e2528cc8d12 to your computer and use it in GitHub Desktop.
clipboard-editor
#!/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" # 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