aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwa.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/wa.sh b/wa.sh
new file mode 100755
index 0000000..39ac46f
--- /dev/null
+++ b/wa.sh
@@ -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