diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-11-06 17:09:50 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-11-06 17:09:50 +0100 |
commit | 42b4dd8a0319a8828e6aea97b847ed554d22f15e (patch) | |
tree | c3649f1b3a17455bcf7aa4e30469aa2be39c9823 | |
parent | 2ab348bf85808d296cf74c7e7d5e402defb85e5b (diff) | |
download | scripts-42b4dd8a0319a8828e6aea97b847ed554d22f15e.tar.gz scripts-42b4dd8a0319a8828e6aea97b847ed554d22f15e.zip |
Created monospace whatsapp message clipboard utility.
-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 |