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:
parent
0e4406bffa
commit
65d9d60ff1
3 changed files with 28 additions and 6 deletions
|
@ -28,4 +28,14 @@ contacts() {
|
||||||
' "$CONTACTSFILE" -
|
' "$CONTACTSFILE" -
|
||||||
}
|
}
|
||||||
|
|
||||||
contacts
|
all_contacts() {
|
||||||
|
cat "$CONTACTSFILE" | awk -F'\t' '{
|
||||||
|
if (substr($0,1,1) == "+") print $1 ": " $2
|
||||||
|
}' | sort -f -k 2
|
||||||
|
}
|
||||||
|
|
||||||
|
if [ "$1" = "--all" ]; then
|
||||||
|
all_contacts
|
||||||
|
else
|
||||||
|
contacts
|
||||||
|
fi
|
||||||
|
|
|
@ -18,7 +18,12 @@ modem_n() {
|
||||||
dialmenu() {
|
dialmenu() {
|
||||||
CONTACTS="$(sxmo_contacts.sh)"
|
CONTACTS="$(sxmo_contacts.sh)"
|
||||||
NUMBER="$(
|
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 . |
|
grep . |
|
||||||
sxmo_dmenu_with_kb.sh -l 10 -p Number -c -fn Terminus-20 -i
|
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
|
echo "Attempting to dial: $NUMBER" >&2
|
||||||
CALLID="$(
|
CALLID="$(
|
||||||
mmcli -m "$(modem_n)" --voice-create-call "number=$NUMBER" |
|
mmcli -m "$(modem_n)" --voice-create-call "number=$NUMBER" |
|
||||||
grep -Eo "Call/[0-9]+" |
|
grep -Eo "Call/[0-9]+" |
|
||||||
grep -oE "[0-9]+"
|
grep -oE "[0-9]+"
|
||||||
)"
|
)"
|
||||||
echo "Starting call with CALLID: $CALLID" >&2
|
echo "Starting call with CALLID: $CALLID" >&2
|
||||||
|
|
|
@ -38,13 +38,20 @@ choosenumbermenu() {
|
||||||
|
|
||||||
# Prompt for number
|
# Prompt for number
|
||||||
NUMBER="$(
|
NUMBER="$(
|
||||||
printf %b "\nCancel\n$(sxmo_contacts.sh)" |
|
printf %b "\nCancel\nMore contacts\n$(sxmo_contacts.sh)" |
|
||||||
awk NF |
|
awk NF |
|
||||||
menu sxmo_dmenu_with_kb.sh -p "Number" -fn "Terminus-20" -l 10 -c -i |
|
menu sxmo_dmenu_with_kb.sh -p "Number" -fn "Terminus-20" -l 10 -c -i |
|
||||||
cut -d: -f1 |
|
cut -d: -f1 |
|
||||||
tr -d -- '- '
|
tr -d -- '- '
|
||||||
)"
|
)"
|
||||||
echo "$NUMBER" | grep -E "^Cancel$" && exit 1
|
echo "$NUMBER" | grep -qE "^Morecontacts$" && NUMBER="$( #joined words without space is not a bug
|
||||||
|
printf %b "\nCancel\n$(sxmo_contacts.sh --all)" |
|
||||||
|
grep . |
|
||||||
|
sxmo_dmenu_with_kb.sh -l 10 -p Number -c -fn Terminus-20 -i
|
||||||
|
cut -d: -f1 |
|
||||||
|
tr -d -- '- '
|
||||||
|
)"
|
||||||
|
echo "$NUMBER" | grep -qE "^Cancel$" && exit 1
|
||||||
echo "$NUMBER" | grep -qE '^[+0-9]+$' || err "That doesn't seem like a valid number"
|
echo "$NUMBER" | grep -qE '^[+0-9]+$' || err "That doesn't seem like a valid number"
|
||||||
echo "$NUMBER"
|
echo "$NUMBER"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue