diff --git a/programs/sxmo_screenlock.c b/programs/sxmo_screenlock.c index e44ac3f..30231de 100644 --- a/programs/sxmo_screenlock.c +++ b/programs/sxmo_screenlock.c @@ -257,13 +257,7 @@ syncstate() void updatestatusbar() { - pid_t statusbarpid = -1; - 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); + system("sxmo_statusbarupdate.sh"); } void diff --git a/scripts/core/sxmo_audioout.sh b/scripts/core/sxmo_audioout.sh index 710cf58..00b0ac1 100755 --- a/scripts/core/sxmo_audioout.sh +++ b/scripts/core/sxmo_audioout.sh @@ -17,4 +17,4 @@ elif [ "$ARG" = "Earpiece" ]; then amixer set "$EARPIECE" unmute fi -pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1 +sxmo_statusbarupdate.sh diff --git a/scripts/core/sxmo_timezonechange.sh b/scripts/core/sxmo_timezonechange.sh index 767956d..75e53b3 100755 --- a/scripts/core/sxmo_timezonechange.sh +++ b/scripts/core/sxmo_timezonechange.sh @@ -3,7 +3,7 @@ change() { echo "Changing timezone to $1" sudo setup-timezone -z "$1" - pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1 + sxmo_statusbarupdate.sh echo Timezone changed ok read -r } diff --git a/scripts/core/sxmo_vol.sh b/scripts/core/sxmo_vol.sh index b45682b..7fbef48 100755 --- a/scripts/core/sxmo_vol.sh +++ b/scripts/core/sxmo_vol.sh @@ -8,7 +8,7 @@ notify() { xargs printf %.0f )" dunstify -i 0 -u normal -r 998 "♫ $VOL" - pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1 + sxmo_statusbarupdate.sh } up() { diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index 6d6d8cc..c0d161d 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -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 diff --git a/scripts/modem/sxmo_modemdial.sh b/scripts/modem/sxmo_modemdial.sh index 1f15550..711144d 100755 --- a/scripts/modem/sxmo_modemdial.sh +++ b/scripts/modem/sxmo_modemdial.sh @@ -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 } diff --git a/scripts/modem/sxmo_modemmonitortoggle.sh b/scripts/modem/sxmo_modemmonitortoggle.sh index 07b3989..e90f002 100755 --- a/scripts/modem/sxmo_modemmonitortoggle.sh +++ b/scripts/modem/sxmo_modemmonitortoggle.sh @@ -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