Use sxmo_statusbarupdate.sh script instead of direct calls duplicated logic

master
Miles Alan 5 years ago
parent 10705f08cd
commit d713b19199
  1. 8
      programs/sxmo_screenlock.c
  2. 2
      scripts/core/sxmo_audioout.sh
  3. 2
      scripts/core/sxmo_timezonechange.sh
  4. 2
      scripts/core/sxmo_vol.sh
  5. 4
      scripts/modem/sxmo_modemcall.sh
  6. 2
      scripts/modem/sxmo_modemdial.sh
  7. 2
      scripts/modem/sxmo_modemmonitortoggle.sh

@ -257,13 +257,7 @@ syncstate()
void void
updatestatusbar() updatestatusbar()
{ {
pid_t statusbarpid = -1; system("sxmo_statusbarupdate.sh");
char buffer[999];
// TODO: there's probably a better way..
if (fgets(buffer, 999, popen("pgrep -f sxmo_statusbar.sh", "r")) != NULL)
statusbarpid = (pid_t) atoi(buffer);
if (statusbarpid != -1)
kill(statusbarpid, SIGUSR1);
} }
void void

@ -17,4 +17,4 @@ elif [ "$ARG" = "Earpiece" ]; then
amixer set "$EARPIECE" unmute amixer set "$EARPIECE" unmute
fi fi
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1 sxmo_statusbarupdate.sh

@ -3,7 +3,7 @@
change() { change() {
echo "Changing timezone to $1" echo "Changing timezone to $1"
sudo setup-timezone -z "$1" sudo setup-timezone -z "$1"
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1 sxmo_statusbarupdate.sh
echo Timezone changed ok echo Timezone changed ok
read -r read -r
} }

@ -8,7 +8,7 @@ notify() {
xargs printf %.0f xargs printf %.0f
)" )"
dunstify -i 0 -u normal -r 998 "$VOL" dunstify -i 0 -u normal -r 998 "$VOL"
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1 sxmo_statusbarupdate.sh
} }
up() { up() {

@ -9,7 +9,7 @@ fatalerr() {
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all 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 alsactl --file /usr/share/sxmo/default_alsa_sound.conf restore
notify-send "$1" 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 kill -9 0
} }
@ -121,7 +121,7 @@ incallsetup() {
incallmonitor() { incallmonitor() {
CALLID="$1" CALLID="$1"
while true; do 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 if mmcli -m "$(modem_n)" -K -o "$CALLID" | grep -E "^call.properties.state.+terminated"; then
fatalerr "Call with $NUMBER terminated" fatalerr "Call with $NUMBER terminated"
fi fi

@ -5,7 +5,7 @@ fatalerr() {
# E.g. hangup all calls, switch back to default audio, notify user, and die # 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 mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
notify-send "$1" 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 kill -9 0
} }

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

Loading…
Cancel
Save