From 45c571727cf28e462f59f7c454d53ca95343d260 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Sat, 22 Aug 2020 15:00:47 -0500 Subject: [PATCH] Cleanup logic for notification LED setting; increase default call volume --- programs/sxmo_megiaudioroute.c | 6 +++--- scripts/modem/sxmo_modemcall.sh | 2 ++ scripts/notifications/sxmo_notificationmonitor.sh | 8 +++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/programs/sxmo_megiaudioroute.c b/programs/sxmo_megiaudioroute.c index 8ce749c..4edd0d8 100644 --- a/programs/sxmo_megiaudioroute.c +++ b/programs/sxmo_megiaudioroute.c @@ -351,9 +351,9 @@ static struct audio_setup audio_setup = { .dai2_en = false, - .hp_vol = 15, - .spk_vol = 15, - .ear_vol = 15, + .hp_vol = 25, + .spk_vol = 25, + .ear_vol = 25, .mic_gain = 1, .hpmic_gain = 1, }; diff --git a/scripts/modem/sxmo_modemcall.sh b/scripts/modem/sxmo_modemcall.sh index 1e2cee4..d612bc0 100755 --- a/scripts/modem/sxmo_modemcall.sh +++ b/scripts/modem/sxmo_modemcall.sh @@ -152,6 +152,8 @@ incallmenuloop() { DTMF Tones ^ dtmfmenu $CALLID Hangup ^ hangup $CALLID " + + pkill -9 dmenu # E.g. just incase user is playing with btns or hits a menu by mistake echo "$CHOICES" | xargs -0 echo | cut -d'^' -f1 | diff --git a/scripts/notifications/sxmo_notificationmonitor.sh b/scripts/notifications/sxmo_notificationmonitor.sh index ec37204..b581b9c 100755 --- a/scripts/notifications/sxmo_notificationmonitor.sh +++ b/scripts/notifications/sxmo_notificationmonitor.sh @@ -11,8 +11,10 @@ notificationhook() { if [ -x "$XDG_CONFIG_HOME"/sxmo/hooks/notification ]; then "$XDG_CONFIG_HOME"/sxmo/hooks/notification else + sxmo_setpineled green 0 sxmo_vibratepine 200; sleep 0.1; + sxmo_setpineled green 1 sxmo_vibratepine 200; sleep 0.1; fi @@ -25,7 +27,6 @@ handlenewnotiffile(){ echo "Invalid notification file $NOTIFFILE found (<3 lines -- see notif spec in sxmo_notifwrite.sh), deleting!" >&2 rm -f "$NOTIFFILE" else - sxmo_setpineled green 1; notificationhook & NOTIFACTION="$(awk NR==1 "$NOTIFFILE")" NOTIFWATCHFILE="$(awk NR==2 "$NOTIFFILE")" @@ -33,6 +34,7 @@ handlenewnotiffile(){ if dunstify --action="2,open" "$NOTIFMSG" | grep 2; then setsid -f sh -c "$NOTIFACTION" & + rm -f "$NOTIFFILE" elif [ -e "$NOTIFWATCHFILE" ]; then (inotifywait "$NOTIFWATCHFILE" && rm -f "$NOTIFFILE") & fi @@ -48,7 +50,8 @@ recreateexistingnotifs() { monitorforaddordelnotifs() { while true; do - find "$NOTIFDIR"/ -type f -mindepth 1 | read -r || sxmo_setpineled green 0 + [ $(find "$NOTIFDIR"/ -type f | wc -l) -lt 1 ] && sxmo_setpineled green 0 + inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | ( INOTIFYOUTPUT="$(cat)" INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)" @@ -61,6 +64,5 @@ monitorforaddordelnotifs() { pgrep -f "$(command -v sxmo_notificationmonitor.sh)" | grep -Ev "^${$}$" | xargs kill rm -f $NOTIFDIR/incomingcall -sxmo_setpineled green 0 recreateexistingnotifs monitorforaddordelnotifs