diff options
-rwxr-xr-x | wa.sh | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -0,0 +1,20 @@ +#!/bin/sh + +# wa.sh +# +# Usage: wa.sh +# +# Passes input to clipboard surrounded by Whatsapp's +# monospace macro lines. +# +# wa.sh uses 'cat -' to process input, so standard +# input is read if no input is provided. + +if ! type xsel >/dev/null; then + echo "xsel not found: wa.sh depends on xsel." 1>&2 + exit 1 +fi + +echo '```' | xsel -bi +cat - | xsel -ba +echo -n '```' | xsel -ba |