From 3e63093b5de920968a4128758dc9aa230171ff1a Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 12 Jul 2021 17:28:48 +0200 Subject: [PATCH] more reliable rss notifs, seperating into notifs --- .local/bin/newsboatnotifs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.local/bin/newsboatnotifs b/.local/bin/newsboatnotifs index 25e26e1..3c3f6c7 100755 --- a/.local/bin/newsboatnotifs +++ b/.local/bin/newsboatnotifs @@ -12,7 +12,7 @@ unread="$(sqlite3 "$CACHE" "SELECT unread,pubDate,title,feedurl FROM rss_item;" echo "$unread" >> "$ALREADY_NOTIFIED" [ "$( echo "$unread" | wc -l)" -gt 1 ] && plural=s articles="$(echo "$unread" | cut -d'|' -f3,4)" -output="$(echo "$articles" | while read -r article; do +echo "$articles" | while read -r article; do #remove '?' queries from URL title="$(echo "$article" | cut -d'|' -f1)" feed="$(echo "$article" | cut -d'|' -f2 | sed 's/?.*//')" @@ -20,13 +20,13 @@ output="$(echo "$articles" | while read -r article; do name="$(grep "$feed" "$CONFIG" | grep '~' | perl -pe "s/[^~\"]*\"~([^\"]*).*/\1/")" #If no custom name present, use name from CACHE + echo "$feed" if [ -z "$name" ]; then - name="$(sqlite3 "$CACHE" "SELECT url,title FROM rss_feed;" | + name="$(sqlite3 "$CACHE" "SELECT rssurl,title FROM rss_feed;" | grep -F "$feed" | cut -d'|' -f2)" fi - printf '%s:\n%s\n' "$name" "$title" -done)" -notify-send "new article${plural}" "$output" + notify-send "${name}:" "$title" +done #update statusbar to account for new articles pkill -RTMIN+13 dwmblocks