From 01d77b674ac600d21cb05b4a9c8f0c8aa464195b Mon Sep 17 00:00:00 2001 From: Steven Saus Date: Tue, 19 Dec 2023 23:27:35 -0500 Subject: [PATCH] Seems to work! --- patootie.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/patootie.sh b/patootie.sh index 713fb97..b69cbea 100755 --- a/patootie.sh +++ b/patootie.sh @@ -28,8 +28,8 @@ ANSWER=$(yad --form --separator="±" --item-separator="," --columns=2 --title "p --item-separator="," --button=Cancel:99 --button=Post:0) -TootText=$(echo "${ANSWER}" | awk -F '±' '{print $1}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g') -ContentWarning=$(echo "${ANSWER}" | awk -F '±' '{print $2}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g') +TootText=$(echo "${ANSWER}" | awk -F '±' '{print $1}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/ -- /—/g' -e 's/ — /—/g' -e 's/ - /—/g' -e 's/ – /—/g' -e 's/ – /—/g') +ContentWarning=$(echo "${ANSWER}" | awk -F '±' '{print $2}' | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/ -- /—/g' -e 's/(/—/g' -e 's/)/—/g' -e 's/ — /—/g' -e 's/ - /—/g' -e 's/ – /—/g' -e 's/ – /—/g') if [ "$ContentWarning" == "none" ];then ContentWarning="" fi @@ -51,13 +51,16 @@ if [ "${Need_Image}" == "TRUE" ];then SendImage=$(mktemp --suffix=.${extension}) cp "${IMAGE_FILE}" "${SendImage}" fi - ALT_TEXT=$(yad --window-icon=musique --on-top --skip-taskbar --image-on-top --borders=5 --title "Choose your alt text" --image "${SendImage}" --form --separator="±" --item-separator="," --text-align=center --field="Alt text to use?:TXT" "I was too lazy to put alt text" --item-separator="," --separator="±") + ALT_TEXT=$(yad --window-icon=musique --on-top --skip-taskbar --image-on-top --borders=5 --title "Choose your alt text" --image "${SendImage}" --form --separator="" --item-separator="," --text-align=center --field="Alt text to use?:TXT" "I was too lazy to put alt text" --item-separator="," --separator="") + echo "$ALT_TEXT" if [ ! -z "$ALT_TEXT" ];then - AltText=$(echo "${ALT_TEXT}" | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/—/ -- /g' -e 's/ — / -- /g' -e 's/ - / -- /g' -e 's/ – / -- /g' -e 's/ – / -- /g') - AltText=" --description ${AltText}" + # parens changed here because otherwise eval chokes + AltText=$(echo "${ALT_TEXT}" | sed -e 's/"/“/g' -e "s/'/’/g" -e 's/ -- /—/g' -e 's/(/—/g' -e 's/)/—/g' -e 's/ — /—/g' -e 's/ - /—/g' -e 's/ – /—/g' -e 's/ – /—/g') + AltText=" --description \"${AltText}\"" else AltText="" fi + echo "$AltText" # now adding the beginning part to the SendImage string for binary usage SendImage=" --media ${SendImage}" fi