scripts/get_newsboat.sh
2023-06-28 16:25:32 -04:00

33 lines
466 B
Bash
Executable file

#!/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