Use sxmo_statusbarupdate.sh script instead of direct calls duplicated logic

This commit is contained in:
Miles Alan 2020-07-12 11:38:31 -05:00
parent 10705f08cd
commit d713b19199
7 changed files with 8 additions and 14 deletions

View file

@ -9,7 +9,7 @@ fatalerr() {
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
alsactl --file /usr/share/sxmo/default_alsa_sound.conf restore
notify-send "$1"
setsid -f sh -c 'sleep 2; pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1'
setsid -f sh -c 'sleep 2; smxo_statusbarupdate.sh'
kill -9 0
}
@ -121,7 +121,7 @@ incallsetup() {
incallmonitor() {
CALLID="$1"
while true; do
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
sxmo_statusbarupdate.sh
if mmcli -m "$(modem_n)" -K -o "$CALLID" | grep -E "^call.properties.state.+terminated"; then
fatalerr "Call with $NUMBER terminated"
fi

View file

@ -5,7 +5,7 @@ fatalerr() {
# E.g. hangup all calls, switch back to default audio, notify user, and die
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
notify-send "$1"
(sleep 0.5; pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1) &
(sleep 0.5; sxmo_statusbarupdate.sh) &
kill -9 0
}

View file

@ -10,4 +10,4 @@ rm /tmp/sxmo_incomingcall
# E.g. wait until process killed or started -- maybe there's a better way..
sleep 1
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
sxmo_statusbarupdate.sh