newsup (587B) - raw


      1 #!/bin/sh
      2 # Set as a cron job to check for new RSS entries for newsboat.
      3 # If newsboat is open, sends it an "R" key to refresh.
      4 
      5 ping -q -c 1 1.1.1.1 > /dev/null || exit
      6 
      7 /usr/bin/notify-send -t 1 -i "$HOME/.fonts/svg/rss.svg" -a RSS "Updating RSS feeds..."
      8 
      9 pgrep -x newsboat >/dev/null && /usr/bin/xdotool key --window "$(/usr/bin/xdotool search --name newsboat)" R && exit
     10 
     11 echo "  " > /tmp/newsupdate && kill -37 $(pidof dwmblocks)
     12 /usr/bin/newsboat -x reload
     13 rm -f /tmp/newsupdate
     14 /usr/bin/notify-send -t 1 -a " RSS" "RSS feed update complete." && kill -37 $(pidof dwmblocks)