From a60641cebcf903a43ba9d8fe6adb2140a7a80e42 Mon Sep 17 00:00:00 2001 From: Miles Alan Date: Thu, 10 Sep 2020 19:08:00 -0500 Subject: [PATCH] Retain position in RSS script when selecting items --- scripts/appscripts/sxmo_rss.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/appscripts/sxmo_rss.sh b/scripts/appscripts/sxmo_rss.sh index d347580..2b50862 100755 --- a/scripts/appscripts/sxmo_rss.sh +++ b/scripts/appscripts/sxmo_rss.sh @@ -92,13 +92,18 @@ rssreadmenu() { tr -d ' ' )" + CHOICES="$(list_items)" + DMENUIDX=1 while true; do # Show list of items - PICKED=$(list_items | dmenu -p "RSS ($TIMESPANABBR)" -c -l 20 -fn Terminus-15) + PICKED="$(printf %b "$CHOICES" | dmenu -idx $DMENUIDX -p "RSS ($TIMESPANABBR)" -c -l 20 -fn Terminus-15)" + DMENUIDX="$(echo "$CHOICES" | grep -m1 -F -n "$PICKED" | cut -d ':' -f1)" if [ "$PICKED" = "Close Menu" ]; then - die Closed Menu + die Closed Menu elif [ "$PICKED" = "Change Timespan" ]; then - rsstimespanmenu + rsstimespanmenu + CHOICES="$(list_items)" + DMENUIDX=1 else URL="$(echo "$PICKED" | gawk -F " " '{print $NF}')" sxmo_urlhandler.sh "$URL" fork