summaryrefslogtreecommitdiff
path: root/ar/.local/bin/cron
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-06-16 15:44:33 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2026-06-16 15:44:33 +0900
commitaa434f25381ae6236afd3273df8238eadc80b32b (patch)
treea88e61a19fb9f2b695569feab98dae57e4bbdeff /ar/.local/bin/cron
parentfdc9dd9666dbf630b6d432dc20a56298779cde32 (diff)
modified cron/newsup, modified statusbar/sb-news
Diffstat (limited to 'ar/.local/bin/cron')
-rwxr-xr-xar/.local/bin/cron/newsup8
1 files changed, 7 insertions, 1 deletions
diff --git a/ar/.local/bin/cron/newsup b/ar/.local/bin/cron/newsup
index 4d387eb..f8e3181 100755
--- a/ar/.local/bin/cron/newsup
+++ b/ar/.local/bin/cron/newsup
@@ -3,9 +3,15 @@
# Set as a cron job to check for new RSS entries for newsboat.
# If newsboat is open, sends it an "R" key to refresh.
+# Bail if a previous run is still going. With the fulltext filter a reload now
+# takes ~17s+, so back-to-back cron ticks could overlap: a second `-x reload`
+# can't grab the cache.db lock, and the rm/signal races blank the status bar.
+exec 9>/tmp/newsup.lock
+flock -n 9 || exit
+
/usr/bin/notify-send "📰 Updating RSS feeds..."
-pgrep -f newsboat$ && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name "^newsboat$")" R && exit
+pgrep -x newsboat && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name "^newsboat$")" R && exit
echo "📰$(/usr/bin/newsboat -x print-unread | awk '{print $1}')🔃" >/tmp/newsupdate
pkill -RTMIN+14 "${STATUSBAR:-dwmblocks}"