added pronoun selector. add

This commit is contained in:
konomo 2021-11-05 16:14:32 +00:00
parent 014c74fb11
commit 67e1f6d870
2 changed files with 31 additions and 1 deletions

View File

@ -11,3 +11,4 @@ copy it into your gemini directory and make it executable of course
## Changelog
* 2021-10-18: thrown together in an hour
* 2021-10-19: thrown through shellcheck
* 2021-11-05: added pronoun selector. add ";" and your preferred pronouns into the name field to see only those

View File

@ -1,10 +1,19 @@
#!/usr/bin/env bash
if [[ -z "$QUERY_STRING" ]]; then
printf "10 Please enter your name!\r\n"
fi
name=$QUERY_STRING
pronouns=""
setnumber=999
if [[ "${name}" == *"%3B"* ]]; then
pronouns="${name#*%3B}"
name=$(echo -n "${name}" | sed 's/%3B.*//')
fi
printf "20 text/gemini\r\n"
printf "# Pronoun Dressing Room for %s\n" "$name"
printf "# Pronoun Dressing Room for %s" "$name"
sentences=("I really enjoy spending time with OBJECTIVE." "NAME is really cool, I like OBJECTIVE." "POSESSIVEDT accent is nice." "That belongs to OBJECTIVE." "NAME did so well, SUBJECTIVE MSHAS every reason to be proud of REFLEXIVE.")
@ -16,7 +25,27 @@ pr_ref=("himself" "herself" "themselves" "xemself")
cnt=0
if [[ "${pronouns}" != "" ]]; then
for i in "${pr_sub[@]}"; do
if [[ "${i}" == "${pronouns}" ]]; then
setnumber=$cnt
fi
((cnt++))
done
printf ", the pronouns are %s\n" "$pronouns"
else
printf "\n"
fi
cnt=0
for i in "${pr_sub[@]}"; do
if [[ "${setnumber}" != 999 ]]; then
if [[ "${setnumber}" != "${cnt}" ]]; then
((cnt++))
continue
fi
fi
printf "%s:\n---\n" "$i"
for j in "${sentences[@]}"; do