This looks much cleaner with the rest of the UI already using glyphs
anyway.
Additionally split the long ATTACHMENTS assignment into multiple lines,
fix printf formatting usage and basename for filenames with spaces.
Signed-off-by: Jami Kettunen <jami.kettunen@protonmail.com>
---
configs/default_hooks/sxmo_hook_icons.sh | 2 +-
scripts/modem/sxmo_modemtext.sh | 7 +++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/configs/default_hooks/sxmo_hook_icons.sh b/configs/default_hooks/sxmo_hook_icons.sh
index dcb5c98..fef5a8b 100644
--- a/configs/default_hooks/sxmo_hook_icons.sh
+++ b/configs/default_hooks/sxmo_hook_icons.sh
@@ -23,7 +23,7 @@ icon_ard=""
icon_arl=""
icon_arr=""
icon_aru=""
-icon_att="📎"
+icon_att=""
icon_bel=""
icon_bok=""
icon_btd="" # bluethooth device
diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh
index 12be29a..08cfa17 100755
--- a/scripts/modem/sxmo_modemtext.sh
+++ b/scripts/modem/sxmo_modemtext.sh
@@ -67,7 +67,10 @@ sendtextmenu() {
ATTACHMENTS=
if [ -f "$SXMO_LOGDIR/$NUMBER/draft.attachments.txt" ]; then
# shellcheck disable=SC2016
- ATTACHMENTS="$(tr '\n' '\0' < "$SXMO_LOGDIR/$NUMBER/draft.attachments.txt" | xargs -0 -I{} sh -c 'printf " 📎 "$(basename {})" :: {}\n"')"
+ ATTACHMENTS="$(
+ tr '\n' '\0' < "$SXMO_LOGDIR/$NUMBER/draft.attachments.txt" |
+ xargs -0 -I{} sh -c 'printf "%s %s %s :: %s\n" "" "" "$(basename "{}")" "{}"'
+ )"
fi
RECIPIENTS=
@@ -94,7 +97,7 @@ sendtextmenu() {
fi
;;
# Remove Attachment
- " 📎"*)
+ " "*)
FILE="$(printf %s "$CONFIRM" | awk -F' :: ' '{print $2}')"
sed -i "\|$FILE|d" "$SXMO_LOGDIR/$NUMBER/draft.attachments.txt"
if [ ! -s "$SXMO_LOGDIR/$NUMBER/draft.attachments.txt" ] ; then
--
2.36.1