From 1253dcd5f1b5a1bb17dc5763a918ce640d27148b Mon Sep 17 00:00:00 2001 From: Julian P Samaroo Date: Thu, 3 Sep 2020 17:50:35 -0500 Subject: [PATCH] Added Clear Notifications option to menu --- scripts/notifications/sxmo_notificationsmenu.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/notifications/sxmo_notificationsmenu.sh b/scripts/notifications/sxmo_notificationsmenu.sh index d98c4d5..fddef71 100755 --- a/scripts/notifications/sxmo_notificationsmenu.sh +++ b/scripts/notifications/sxmo_notificationsmenu.sh @@ -2,7 +2,7 @@ NOTIFDIR="$XDG_CONFIG_HOME"/sxmo/notifications notificationmenu() { - CHOICES="Close Menu" + CHOICES="Close Menu\nClear Notifications" for NOTIFFILE in "$NOTIFDIR"/*; do NOTIFMSG="$(tail -n+3 "$NOTIFFILE" | tr "\n^" " ")" NOTIFHRANDMIN="$(stat --printf %y "$NOTIFFILE" | grep -oE '[0-9]{2}:[0-9]{2}')" @@ -22,6 +22,7 @@ notificationmenu() { )" [ "$PICKEDCONTENT" = "Close Menu" ] && exit 1 + [ "$PICKEDCONTENT" = "Clear Notifications" ] && rm "$NOTIFDIR"/* && exit 1 PICKEDNOTIFFILE="$(echo "$CHOICES" | grep "$PICKEDCONTENT" | cut -d^ -f2 | tr -d ' ')" NOTIFACTION="$(head -n1 "$PICKEDNOTIFFILE")"