Last active
August 2, 2024 08:08
-
-
Save zunda/0bd332688300339c3edd to your computer and use it in GitHub Desktop.
A scratch pad to be run from a lunch short cut within a terminal on an X11 desktop. Grabs selected text and pastes the completed text onto the clipboard.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
path=$(mktemp -p /tmp scratch.$(date +%Y%m%d-%H%M%S).XXXX.txt) | |
xsel -o -p > $path | |
/usr/bin/vim -c 'set enc=utf8 fenc=utf8' $path | |
cat $path | xsel -i -b | |
cat $path | xsel -i -p | |
sleep 0.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment