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.
This commit is contained in:
parent
7559984430
commit
c5b665ca4f
5 changed files with 5 additions and 15 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue