Add x-scheme-handler/tel handler with a dedicated menu

This menu allow the user to

- call
- text
- save

The tel number.
master
Stacy Harper 3 years ago
parent 87d86b7cf0
commit af856d5bfa
No known key found for this signature in database
GPG Key ID: EABA44759877E02A
  1. 6
      configs/applications/sxmo-phone-menu.desktop
  2. 25
      configs/firefox/handlers.json
  3. 1
      configs/xdg/mimeapps.list
  4. 15
      scripts/core/sxmo_contactmenu.sh
  5. 27
      scripts/core/sxmo_phonemenu.sh

@ -0,0 +1,6 @@
[Desktop Entry]
Name=Sxmo Phone Menu
Exec=sxmo_phonemenu.sh
Terminal=false
Type=Application
MimeType=x-scheme-handler/tel

@ -0,0 +1,25 @@
{
"defaultHandlersVersion": {
"en-US": 4
},
"mimeTypes": {
"application/pdf": {
"action": 3,
"extensions": [
"pdf"
]
}
},
"schemes": {
"tel": {
"action": 2,
"ask": false,
"handlers": [
{
"name": "sxmo",
"path": "/usr/bin/sxmo_open.sh"
}
]
}
}
}

@ -5,3 +5,4 @@ image/gif=sxmo-sxiv.desktop
audio/x-m4a=sxmo-mpv-music.desktop
audio/mpeg=sxmo-mpv-music.desktop
application/pdf=sxmo-zathura.desktop
x-scheme-handler/tel=sxmo-phone-menu.desktop

@ -5,7 +5,12 @@
newcontact() {
name="$(echo | sxmo_dmenu_with_kb.sh -p "$icon_usr Name")"
number=
number="$1"
if [ -n "$number" ]; then
number="$(valid_number "$number")"
fi
while [ -z "$number" ]; do
number="$(sxmo_contacts.sh --unknown | sxmo_dmenu_with_kb.sh -p "$icon_phl Number")"
number="$(valid_number "$number")"
@ -132,4 +137,10 @@ main() {
done
}
main
if [ -n "$1" ]; then
cmd="$1"
else
cmd=main
fi
"$cmd" "$@"

@ -0,0 +1,27 @@
#!/usr/bin/env sh
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"
set -e
number="$(printf "%s" "$1" | sed -e "s/^tel://")"
number="$(sxmo_validnumber.sh "$number")"
result="$(printf "%s Call %s\n%s Text %s\n%s Save %s\n%s Close Menu\n" \
"$icon_phn" "$number" "$icon_msg" "$number" "$icon_sav" "$number" \
"$icon_cls" \
| sxmo_dmenu.sh -p "Action")"
case "$result" in
*Call*)
sxmo_modemdial.sh "$number"
;;
*Text*)
sxmo_textmenu.sh "$number"
;;
*Save*)
sxmo_contactmenu.sh newcontact "$number"
;;
esac
Loading…
Cancel
Save