diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup new file mode 100755 index 0000000..133581d --- /dev/null +++ b/.local/bin/cron/newsup @@ -0,0 +1,15 @@ +#!/bin/sh + +ping -q -c 1 1.1.1.1 > /dev/null || exit 1 + +ps ax | grep -q newsboat$ && \ + /usr/bin/xdotool key --window \ + "$(/usr/bin/xdotool search --name newsboat)" R && exit + +echo " " > /tmp/newsupdate +refbar & +/usr/bin/newsboat -x reload +rm -f /tmp/newsupdate +refbar & + +newsboat -x print-unread | awk '{ print $1 }' > "$HOME/.cache/news_unread"