From 0c2b11c2f37e2cfdfd73b43b49c8cc21a5d00ac8 Mon Sep 17 00:00:00 2001 From: Julian P Samaroo Date: Sat, 12 Dec 2020 17:12:26 -0600 Subject: [PATCH] Sort notifications menu Signed-off-by: Maarten van Gompel --- scripts/notifications/sxmo_notificationsmenu.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/notifications/sxmo_notificationsmenu.sh b/scripts/notifications/sxmo_notificationsmenu.sh index dff161a..c5d0bb4 100755 --- a/scripts/notifications/sxmo_notificationsmenu.sh +++ b/scripts/notifications/sxmo_notificationsmenu.sh @@ -3,12 +3,12 @@ NOTIFDIR="$XDG_DATA_HOME"/sxmo/notifications notificationmenu() { 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}')" + for NOTIFFILE in $(ls -tr $NOTIFDIR); do + NOTIFMSG="$(tail -n+3 "$NOTIFDIR/$NOTIFFILE" | tr "\n^" " ")" + NOTIFHRANDMIN="$(stat --printf %y "$NOTIFDIR/$NOTIFFILE" | grep -oE '[0-9]{2}:[0-9]{2}')" CHOICES=" $CHOICES - $NOTIFHRANDMIN - $NOTIFMSG ^ $NOTIFFILE + $NOTIFHRANDMIN - $NOTIFMSG ^ $NOTIFDIR/$NOTIFFILE " done