#!/bin/sh CACHE_FILE="/tmp/newsboat-unreads.cache" [ -f "$CACHE_FILE" ] || echo "0" > "$CACHE_FILE" newsboat_loop(){ NO_PROXY=\".com,.org,.xyz,.chat,.social,.net,.co,.love\" newsboat -x reload unreads=$(newsboat -x print-unread) unreadnum=$(printf -- "%s" "$unreads" | sed 's/ .*//g') echo "${unreadnum:-0}" > "$CACHE_FILE" if [ "$unreadnum" -gt 0 ]; then notify-send "newsboat feed" "$unreads" fi notify-send "Vitamins!" "take them" sleep 2h newsboat_loop } newsboat_loop