Add more contacts choice to contact list

The dialer only included recent callers, but there was no way to access
the full contact list (contacts.tsv). I added a "more contacts" options
that calls sxmo_contacts --all, providing an alphabetically sorted list
of all your contacts. It also works for the texting menu.

This is a cleaned up version of an earlier patch by Maarten van Gompel.

Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This commit is contained in:
Reed Wade 2020-10-30 12:06:56 +01:00 committed by Maarten van Gompel
parent 0e4406bffa
commit 65d9d60ff1
3 changed files with 28 additions and 6 deletions

View file

@ -18,7 +18,12 @@ modem_n() {
dialmenu() {
CONTACTS="$(sxmo_contacts.sh)"
NUMBER="$(
printf %b "Close Menu\n$CONTACTS" |
printf %b "Close Menu\nMore contacts\n$CONTACTS" |
grep . |
sxmo_dmenu_with_kb.sh -l 10 -p Number -c -fn Terminus-20 -i
)"
echo "$NUMBER" | grep "More contacts" && NUMBER="$(
printf %b "Close Menu\n$(sxmo_contacts.sh --all)" |
grep . |
sxmo_dmenu_with_kb.sh -l 10 -p Number -c -fn Terminus-20 -i
)"
@ -29,8 +34,8 @@ dialmenu() {
echo "Attempting to dial: $NUMBER" >&2
CALLID="$(
mmcli -m "$(modem_n)" --voice-create-call "number=$NUMBER" |
grep -Eo "Call/[0-9]+" |
mmcli -m "$(modem_n)" --voice-create-call "number=$NUMBER" |
grep -Eo "Call/[0-9]+" |
grep -oE "[0-9]+"
)"
echo "Starting call with CALLID: $CALLID" >&2