scripts/get_newsboat.sh

33 lines
466 B
Bash
Raw Normal View History

#!/bin/bash
loop() {
while true ; do
OUTPUT=$(newsboat -x reload)
if [ $? == 0 ]
then
echo $OUTPUT
break
fi
sleep 1
done
}
check() {
OUTPUT=$(newsboat -x print-unread)
if [ $? == 0 ]
then
echo $OUTPUT | sed 's/ .*/ articles/;s/^/ /'
else
echo " ..."
fi
}
case $1 in
update|up)
loop
;;
fetch|fe)
check
;;
esac