From c0caf245827642f56fd87e968f22dd60bc3c5990 Mon Sep 17 00:00:00 2001 From: konomo Date: Mon, 18 Oct 2021 12:22:31 +0000 Subject: [PATCH] add script --- LICENSE | 2 +- README.md | 11 ++++++++++- index.gmi | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100755 index.gmi diff --git a/LICENSE b/LICENSE index 2071b23..d3f9bb5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) +Copyright (c) 2021 konomo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: diff --git a/README.md b/README.md index c600bc6..7a74fb3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,12 @@ # gem-pd -gem-pd is a Pronoun Dressing Room program for gemini in bash \ No newline at end of file +gem-pd is a Pronoun Dressing Room program for gemini in bash + +made after seeing [https://asteine8.github.io/projects/pronoun-dressing-room/dressing-room/index.html](https://asteine8.github.io/projects/pronoun-dressing-room/dressing-room/index.html) in the web + +## Setup + +copy it into your gemini directory and make it executable of course + +## Changelog +* 2021-10-18: thrown together in an hour diff --git a/index.gmi b/index.gmi new file mode 100755 index 0000000..89dd2db --- /dev/null +++ b/index.gmi @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +if [ -z $QUERY_STRING ]; then + printf "10 Please enter your name!\r\n" +fi +name=$QUERY_STRING +printf "20 text/gemini\r\n" +printf "# Pronoun Dressing Room for ${name}\n" + +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.") + +pr_sub=("he" "she" "they" "xe") +pr_obj=("him" "her" "them" "xem") +pr_psd=("his" "her" "their" "xyr") +pr_pos=("his" "hers" "theirs" "xyrs") +pr_ref=("himself" "herself" "themselves" "xemself") + +cnt=0 + +for i in "${pr_sub[@]}"; do + printf "${i}:\n---\n" + + for j in "${sentences[@]}"; do + cursent="${j}" + + if [[ "${cnt}" == 2 ]]; then + cursent="${cursent//MSHAS/have}" + else + cursent="${cursent//MSHAS/has}" + fi + + cursent="${cursent//MSHAS/has}" + + cursent="${cursent//NAME/${name}}" + cursent="${cursent//SUBJECTIVE/"${pr_sub[${cnt}]}"}" + cursent="${cursent//OBJECTIVE/"${pr_obj[${cnt}]}"}" + cursent="${cursent//POSESSIVEDT/"${pr_psd[${cnt}]}"}" + cursent="${cursent//POSESSIVE/"${pr_pos[${cnt}]}"}" + cursent="${cursent//REFLEXIVE/"${pr_ref[${cnt}]}"}" + printf "${cursent^}\n" + done + + printf "\n" + ((cnt++)) +done + +exit