From ce261fa71ffca1732584a45d85e037f6e62a07c6 Mon Sep 17 00:00:00 2001 From: Teo-CD Date: Tue, 14 Sep 2021 23:43:55 +0100 Subject: [PATCH] Add joke script to generate triangle messages --- Perso/tri.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 Perso/tri.sh diff --git a/Perso/tri.sh b/Perso/tri.sh new file mode 100755 index 0000000..4e0ffef --- /dev/null +++ b/Perso/tri.sh @@ -0,0 +1,33 @@ +#/bin/bash + +read input +characters=$(echo "$input" | grep -oe ".") + +message="" +for char in $characters; do + message="$message""$char"" " +done + +echo 3 +sleep 1 +echo 2 +sleep 1 +echo 1 +sleep 1 + +xdotool type "$message" +xdotool key shift+enter + +spaces="" +for char in $characters; do + if [ "$spaces" ]; then + xdotool type "$char""$spaces" + if [ "$char" = 'i' ] || [ "$char" = 'I' ] || [ "$char" = '1' ] || [ "$char" = 'J' ] || [ "$char" = 'j' ] || [ "$char" = 't' ] || [ "$char" = 'f' ]; then + xdotool type " " + fi + xdotool type "$char" + xdotool key shift+enter + spaces="$spaces"" " + fi + spaces="$spaces"" " +done