pick latest article, not oldest for notif

This commit is contained in:
Alexander Bocken 2021-05-11 18:19:14 +02:00
parent ec84b00705
commit 452fc356d0
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8

View File

@ -1,7 +1,7 @@
#!/bin/sh
CACHE="${XDG_DATA_HOME:-$HOME/.local/share}/newsboat/cache.db"
unread="$(sqlite3 "$CACHE" "SELECT unread,pubDate,title FROM rss_item;" |
grep -vE '^0' | sort -t'|' -k2 -g | head -n1 |
grep -vE '^0' | sort -t'|' -k2 -gr | head -n1 |
sed 's/[0-9]*|[0-9]*|//')"
notify-send "newsboat" "$(printf 'new article:\n %s' "$unread")"