Loop RSS script so that you can launch multiple items without reopening

This commit is contained in:
Miles Alan 2020-07-09 18:17:59 -05:00
parent e0067998c8
commit 95e36ccec2

View file

@ -32,6 +32,7 @@ prep_temp_folder_with_items() {
list_items() {
cd "$FOLDER" || die "Couldn't cd to $FOLDER"
echo "Close Menu"
gawk -F'\t' '{print $1 " " substr(FILENAME, 3) " | " $2 ": " $3}' ./* |\
grep -E '^[0-9]{5}' |\
sort -nk1 |\
@ -56,9 +57,13 @@ echo "1 hour ago
FOLDER="/tmp/sfeed_$(echo "$TIMESPAN" | sed 's/ /_/g')"
prep_temp_folder_with_items
# Show list of items
PICKED=$(list_items | dmenu -p "RSS" -c -l 20 -fn Terminus-15)
while true; do
# Show list of items
PICKED=$(list_items | dmenu -p "RSS" -c -l 20 -fn Terminus-15)
# Handle picked item
URL="$(echo "$PICKED" | gawk -F " " '{print $NF}')"
sxmo_urlhandler.sh "$URL"
[ "$PICKED" = "Close Menu" ] && die Closed Menu
# Handle picked item
URL="$(echo "$PICKED" | gawk -F " " '{print $NF}')"
sxmo_urlhandler.sh "$URL"
done