Look for ATTRIB events for notifications updates; remove "Pickup" menu

Picking up call can be done from both dunst notification & notifications menu;
so for more consistency / less bugs the Pickup menu entry has been removed.
master
Miles Alan 4 years ago
parent 7559984430
commit c5b665ca4f
  1. 10
      scripts/core/sxmo_appmenu.sh
  2. 2
      scripts/modem/sxmo_modemmonitor.sh
  3. 6
      scripts/notifications/sxmo_notificationmonitor.sh
  4. 0
      scripts/notifications/sxmo_notificationsmenu.sh
  5. 2
      scripts/notifications/sxmo_notificationwrite.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)"

@ -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)"

@ -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"
;;

@ -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
Loading…
Cancel
Save