summaryrefslogtreecommitdiffstats
path: root/.local/bin/cron/newsup
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2019-11-23 16:16:30 -0500
committerLuke Smith <luke@lukesmith.xyz>2019-11-23 16:16:30 -0500
commita5e66ac4f45322b3665c944ba34d83b7db43ebc5 (patch)
treebed315d0a7f2c180b3eb634ece3a6a2089cdeb6f /.local/bin/cron/newsup
parent85d353d7963391cd66f23a3e99a66b8b58045e4c (diff)
downloadeibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.gz
eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.tar.zst
eibhear-a5e66ac4f45322b3665c944ba34d83b7db43ebc5.zip
merger of bin
Diffstat (limited to '.local/bin/cron/newsup')
-rwxr-xr-x.local/bin/cron/newsup16
1 files changed, 16 insertions, 0 deletions
diff --git a/.local/bin/cron/newsup b/.local/bin/cron/newsup
new file mode 100755
index 0000000..6b6a348
--- /dev/null
+++ b/.local/bin/cron/newsup
@@ -0,0 +1,16 @@
+#!/usr/bin/env sh
+# Set as a cron job to check for new RSS entries for newsboat.
+# If newsboat is open, sends it an "R" key to refresh.
+
+ping -q -c 1 1.1.1.1 > /dev/null || exit
+
+/usr/bin/notify-send "📰 Updating RSS feeds..."
+
+pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
+
+echo 🔃 > /tmp/newsupdate
+pkill -RTMIN+6 i3blocks
+/usr/bin/newsboat -x reload
+rm -f /tmp/newsupdate
+pkill -RTMIN+6 i3blocks
+/usr/bin/notify-send "📰 RSS feed update complete."