From ae784d0ab0dd2b00b785c5da32f243f59079525b Mon Sep 17 00:00:00 2001 From: Stacy Harper Date: Tue, 22 Jun 2021 08:38:08 +0200 Subject: [PATCH] Fix the notification menu usage when notification are doubled For some reason, some notifications get doubled (probably cause of a modemmonitor issue). Those doubled notifications cant be used with the current notificationsmenu cause the two entry matches the picked text. This make the first one to be picked. Signed-off-by: Stacy Harper Signed-off-by: Maarten van Gompel --- scripts/notifications/sxmo_notificationsmenu.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/notifications/sxmo_notificationsmenu.sh b/scripts/notifications/sxmo_notificationsmenu.sh index 0ee8283..4d59687 100755 --- a/scripts/notifications/sxmo_notificationsmenu.sh +++ b/scripts/notifications/sxmo_notificationsmenu.sh @@ -28,7 +28,7 @@ notificationmenu() { echo "$PICKEDCONTENT" | grep -q "Close Menu" && exit 1 echo "$PICKEDCONTENT" | grep -q "Clear Notifications" && rm "$NOTIFDIR"/* && exit 1 - PICKEDNOTIFFILE="$(echo "$CHOICES" | tr -s ' ' | grep -F "$PICKEDCONTENT" | cut -d^ -f2 | tr -d ' ')" + PICKEDNOTIFFILE="$(echo "$CHOICES" | tr -s ' ' | grep -F "$PICKEDCONTENT" | head -1 | cut -d^ -f2 | tr -d ' ')" NOTIFACTION="$(head -n1 "$PICKEDNOTIFFILE")" setsid -f sh -c "$NOTIFACTION" & rm "$PICKEDNOTIFFILE"