Add a dsubmenu to reply/call on SMS windows

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
master
Stacy Harper 4 years ago committed by Maarten van Gompel
parent 18009c8378
commit 568eac7dd3
  1. 8
      scripts/core/sxmo_appmenu.sh
  2. 7
      scripts/modem/sxmo_modemdial.sh
  3. 2
      scripts/modem/sxmo_modemmonitor.sh
  4. 8
      scripts/modem/sxmo_modemtext.sh

@ -298,6 +298,14 @@ programchoicesinit() {
$icon_trm Buffer ^ 0 ^ type '/buffer ' $icon_trm Buffer ^ 0 ^ type '/buffer '
" "
WINNAME=weechat WINNAME=weechat
elif echo "$WMNAME" | grep -i -w "sms"; then
number="$(echo "$WMNAME" | sed -e 's|^\"||' -e 's|\"$||' | cut -f1 -d' ')"
#sms
CHOICES="
$icon_msg Reply ^ 0 ^ sxmo_modemtext.sh $number
$icon_phn Call ^ 0 ^ sxmo_modemdial.sh $number
"
WINNAME=sms
else else
STSELMODEON="$( STSELMODEON="$(
echo "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' ' echo "$XPROPOUT" | grep -E '^_ST_SELMODE.+=' | cut -d= -f2 | tr -d ' '

@ -17,6 +17,9 @@ modem_n() {
} }
dialmenu() { dialmenu() {
if [ -n "$1" ]; then
NUMBER="$1"
else
CONTACTS="$(sxmo_contacts.sh | grep -E "^\+?[0-9]+:")" CONTACTS="$(sxmo_contacts.sh | grep -E "^\+?[0-9]+:")"
NUMBER="$( NUMBER="$(
printf %b "Close Menu\nMore contacts\n$CONTACTS" | printf %b "Close Menu\nMore contacts\n$CONTACTS" |
@ -31,6 +34,8 @@ dialmenu() {
sxmo_dmenu_with_kb.sh -l 10 -p Number -c -i sxmo_dmenu_with_kb.sh -l 10 -p Number -c -i
)" )"
NUMBER="$(echo "$NUMBER" | cut -d: -f1 | tr -d -- '- ')" NUMBER="$(echo "$NUMBER" | cut -d: -f1 | tr -d -- '- ')"
fi
if [ -z "$NUMBER" ] || [ "$NUMBER" = "CloseMenu" ]; then if [ -z "$NUMBER" ] || [ "$NUMBER" = "CloseMenu" ]; then
#no number selected (probably cancelled), silently discard #no number selected (probably cancelled), silently discard
exit 0 exit 0
@ -49,7 +54,7 @@ dialmenu() {
} }
modem_n || fatalerr "Couldn't determine modem number - is modem online?" modem_n || fatalerr "Couldn't determine modem number - is modem online?"
CREATEDCALLID="$(dialmenu)" CREATEDCALLID="$(dialmenu "$1")"
if [ -n "$CREATEDCALLID" ]; then if [ -n "$CREATEDCALLID" ]; then
sxmo_modemcall.sh pickup "$CREATEDCALLID" sxmo_modemcall.sh pickup "$CREATEDCALLID"
fi fi

@ -172,7 +172,7 @@ checkfornewtexts() {
sxmo_notificationwrite.sh \ sxmo_notificationwrite.sh \
random \ random \
"st -e tail -n9999 -f '$LOGDIR/$NUM/sms.txt'" \ "st -T '$NUM SMS' -e less +F '$LOGDIR/$NUM/sms.txt'" \
"$LOGDIR/$NUM/sms.txt" \ "$LOGDIR/$NUM/sms.txt" \
"Message - $CONTACTNAME: $TEXT" "Message - $CONTACTNAME: $TEXT"

@ -108,7 +108,7 @@ senddrafttextmenu() {
tailtextlog() { tailtextlog() {
if [ "$TERMMODE" != "true" ]; then if [ "$TERMMODE" != "true" ]; then
st -e less +F "$LOGDIR/$1/sms.txt" st -T "$1 SMS" -e less +F "$LOGDIR/$1/sms.txt"
else else
less +F "$LOGDIR/$1/sms.txt" less +F "$LOGDIR/$1/sms.txt"
fi fi
@ -131,4 +131,8 @@ main() {
tailtextlog "$(echo "$CONTACTIDANDNUM" | cut -d: -f1)" tailtextlog "$(echo "$CONTACTIDANDNUM" | cut -d: -f1)"
} }
main if [ -n "$1" ]; then
sendnewtextmenu "$1"
else
main
fi

Loading…
Cancel
Save