From 452db41b366e9020734c713d4a0f84e71c5fdc05 Mon Sep 17 00:00:00 2001 From: Wiktor Zykubek Date: Thu, 14 May 2020 13:12:52 +0200 Subject: [PATCH] Add 'newsup' cron script --- .local/bin/cron/newsup | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 .local/bin/cron/newsup 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"