|
|
@ -15,8 +15,13 @@ |
|
|
|
# Patootie uses the environment variable TOOTACCT to specify the tooting account |
|
|
|
# Patootie uses the environment variable TOOTACCT to specify the tooting account |
|
|
|
# otherwise it uses whichever one is currently active in toot. |
|
|
|
# otherwise it uses whichever one is currently active in toot. |
|
|
|
|
|
|
|
|
|
|
|
# TODO - Start with image select, drop? |
|
|
|
# If an argument is passed, it is assumed to be the image file to attach. |
|
|
|
# move sections to functions so I can swap order |
|
|
|
# TODO - test with spaces for this - do I need to mess with IFS here as well? |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Need_Image="" |
|
|
|
|
|
|
|
IMAGE_FILE="" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
binary=$(which toot) |
|
|
|
binary=$(which toot) |
|
|
|
if [ ! -f "${binary}" ];then |
|
|
|
if [ ! -f "${binary}" ];then |
|
|
@ -24,6 +29,11 @@ if [ ! -f "${binary}" ];then |
|
|
|
exit 99 |
|
|
|
exit 99 |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ -f "${1}" ];then |
|
|
|
|
|
|
|
IMAGE_FILE="${1}" |
|
|
|
|
|
|
|
Need_Image="TRUE" |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
ANSWER=$(yad --form --separator="±" --item-separator="," --columns=2 --title "patootie" \ |
|
|
|
ANSWER=$(yad --form --separator="±" --item-separator="," --columns=2 --title "patootie" \ |
|
|
|
--field="What to toot?:TXT" "" \ |
|
|
|
--field="What to toot?:TXT" "" \ |
|
|
|
--field="ContentWarning:CBE" none,discrimination,bigot,uspol,medicine,violence,reproduction,healthcare,LGBTQIA,climate,SocialMedia \ |
|
|
|
--field="ContentWarning:CBE" none,discrimination,bigot,uspol,medicine,violence,reproduction,healthcare,LGBTQIA,climate,SocialMedia \ |
|
|
@ -37,11 +47,15 @@ if [ "$ContentWarning" == "none" ];then |
|
|
|
ContentWarning="" |
|
|
|
ContentWarning="" |
|
|
|
fi |
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# to see if need to select image |
|
|
|
if [ "$IMAGE_FILE" == "" ];then # if there wasn't one by command line |
|
|
|
Need_Image=$(echo "$ANSWER" | awk -F '±' '{print $3}') |
|
|
|
# to see if need to select image |
|
|
|
|
|
|
|
Need_Image=$(echo "$ANSWER" | awk -F '±' '{print $3}') |
|
|
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ "${Need_Image}" == "TRUE" ];then |
|
|
|
if [ "${Need_Image}" == "TRUE" ];then |
|
|
|
IMAGE_FILE=$(yad --title "Select image to add" --width=500 --height=400 --file --file-filter "Graphic files | *.jpg *.png *.webp *.jpeg") |
|
|
|
if [ "${IMAGE_FILE}" == "" ]; then # if there wasn't one by command line |
|
|
|
|
|
|
|
IMAGE_FILE=$(yad --title "Select image to add" --width=500 --height=400 --file --file-filter "Graphic files | *.jpg *.png *.webp *.jpeg") |
|
|
|
|
|
|
|
fi |
|
|
|
if [ ! -f "${IMAGE_FILE}" ];then |
|
|
|
if [ ! -f "${IMAGE_FILE}" ];then |
|
|
|
SendImage="" |
|
|
|
SendImage="" |
|
|
|
else |
|
|
|
else |
|
|
|