dotfiles

beau's configuration files
git clone https://git.beauhilton.com/dotfiles.git
Log | Files | Refs | README

news (713B)


      1 #!/usr/bin/env sh
      2 
      3 # i3blocks newsboat module.
      4 # Displays number of unread news items and an loading icon if updating.
      5 # When clicked, brings up `newsboat`.
      6 
      7 case $BLOCK_BUTTON in
      8         1) setsid "$TERMINAL" -e newsboat ;;
      9 	2) setsid newsup >/dev/null & exit ;;
     10         3) pgrep -x dunst >/dev/null && notify-send "📰 News module" "\- Shows unread news items
     11 - Shows 🔃 if updating with \`newsup\`
     12 - Left click opens newsboat
     13 - Middle click syncs RSS feeds
     14 <b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;;
     15 esac
     16 
     17  cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)"