summaryrefslogtreecommitdiff
path: root/scriptlets/truth.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scriptlets/truth.sh')
-rwxr-xr-xscriptlets/truth.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/scriptlets/truth.sh b/scriptlets/truth.sh
new file mode 100755
index 0000000..257c6a7
--- /dev/null
+++ b/scriptlets/truth.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+TEXT="$(xclip -o -sel clip)"
+TRUTH=""
+
+REDTRUTH='\e[2;31m'
+BLUETRUTH='\e[2;34m'
+GOLDENTRUTH='\e[2;33m'
+
+while getopts "hrbg" opt; do
+ case $opt in
+ h) echo -e "usage: $0 [-h help] [-r red truth] [-b blue truth] [-g golden truth]" ;;
+ r) TRUTH='```ansi\n'${REDTRUTH}${TEXT}'\e[0m\n```' ;;
+ b) TRUTH='```ansi\n'${BLUETRUTH}${TEXT}'\e[0m\n```' ;;
+ g) TRUTH='```ansi\n'${GOLDENTRUTH}${TEXT}'\e[0m\n```' ;;
+ ?) echo "error: option -$OPTARG is not implemented"; exit ;;
+ esac
+done
+
+echo -e $TRUTH | xclip -sel clip