From 14a892e627a375334a02381351f139d94ad7ecf3 Mon Sep 17 00:00:00 2001 From: ダカマ Date: Mon, 2 Jun 2025 13:08:46 +0200 Subject: First dump --- scriptlets/truth.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 scriptlets/truth.sh (limited to 'scriptlets/truth.sh') 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 -- cgit v1.2.3