diff --git a/scripts/core/sxmo_appmenu.sh b/scripts/core/sxmo_appmenu.sh index bd75512..c82788f 100755 --- a/scripts/core/sxmo_appmenu.sh +++ b/scripts/core/sxmo_appmenu.sh @@ -343,16 +343,6 @@ getprogchoices() { # E.g. sets CHOICES var programchoicesinit "$@" - # Decorate menu at top *always* w/ incoming call entry if present - if [ -e "$NOTIFDIR"/incomingcall ]; then - INCOMINGCALLMSG="$(tail -n+3 "$NOTIFDIR"/incomingcall)" - INCOMINGCALLPICKUPACTION="$(head -n1 "$NOTIFDIR"/incomingcall)" - CHOICES=" - $INCOMINGCALLMSG ^ sh -c "rm "$NOTIFDIR"/incomingcall; "$INCOMINGCALLPICKUPACTION"" - $CHOICES - " - fi - # For the Sys menu decorate at top with notifications if >1 notification if [ "$WINNAME" = "Sys" ]; then NNOTIFICATIONS="$(find "$NOTIFDIR" -type f | wc -l)" diff --git a/scripts/modem/sxmo_modemmonitor.sh b/scripts/modem/sxmo_modemmonitor.sh index 58a9ee6..dd5cb0c 100755 --- a/scripts/modem/sxmo_modemmonitor.sh +++ b/scripts/modem/sxmo_modemmonitor.sh @@ -67,7 +67,7 @@ checkforincomingcalls() { sxmo_notificationwrite.sh \ "$NOTIFDIR/incomingcall" \ "sxmo_modemcall.sh pickup $VOICECALLID" \ - "$NOTIFDIR/incomingcall" \ + "none" \ "Pickup $(sxmo_contacts.sh | grep -E "^$INCOMINGNUMBER")" & echo "Number: $INCOMINGNUMBER (VOICECALLID: $VOICECALLID)" diff --git a/scripts/core/sxmo_notificationmonitor.sh b/scripts/notifications/sxmo_notificationmonitor.sh similarity index 91% rename from scripts/core/sxmo_notificationmonitor.sh rename to scripts/notifications/sxmo_notificationmonitor.sh index 1ccbe39..d38e1ec 100755 --- a/scripts/core/sxmo_notificationmonitor.sh +++ b/scripts/notifications/sxmo_notificationmonitor.sh @@ -33,7 +33,7 @@ handlenewnotiffile(){ if dunstify --action="2,open" "$NOTIFMSG" | grep 2; then eval "$NOTIFACTION" - else + elif [ -e "$NOTIFWATCHFILE" ]; then inotifywait "$NOTIFWATCHFILE" && rm -f "$NOTIFFILE" & fi fi @@ -48,11 +48,11 @@ recreateexistingnotifs() { monitorforaddordelnotifs() { while true; do - inotifywait -e create,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | ( + inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | ( INOTIFYOUTPUT="$(cat)" INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)" case "$INOTIFYEVENTTYPE" in - "CREATE"|"MOVED_TO") + "CREATE"|"MOVED_TO","ATTRIB") NOTIFFILE="$NOTIFDIR/$(echo "$INOTIFYOUTPUT" | cut -d" " -f3)" handlenewnotiffile "$NOTIFFILE" ;; diff --git a/scripts/core/sxmo_notificationsmenu.sh b/scripts/notifications/sxmo_notificationsmenu.sh similarity index 100% rename from scripts/core/sxmo_notificationsmenu.sh rename to scripts/notifications/sxmo_notificationsmenu.sh diff --git a/scripts/core/sxmo_notificationwrite.sh b/scripts/notifications/sxmo_notificationwrite.sh similarity index 85% rename from scripts/core/sxmo_notificationwrite.sh rename to scripts/notifications/sxmo_notificationwrite.sh index 5061f9f..f662596 100755 --- a/scripts/core/sxmo_notificationwrite.sh +++ b/scripts/notifications/sxmo_notificationwrite.sh @@ -18,7 +18,7 @@ writenotification() { NOTIFFILEPATHTOWRITE="$NOTIFDIR/$(tr -dc 'a-zA-Z0-9' < /dev/urandom | head -c 10)" fi touch "$NOTIFFILEPATHTOWRITE" - printf %b "$ACTION\n$WATCHFILE\n$NOTIFMSG\n" > "$NOTIFFILEPATHTOWRITE" + printf %b "rm -f $NOTIFFILEPATHTOWRITE; $ACTION\n$WATCHFILE\n$NOTIFMSG\n" > "$NOTIFFILEPATHTOWRITE" } [ "$#" -lt 4 ] && echo "Need >=4 args to create a notification" && exit 1