In polybar/cron, newsboat won't update if an instance is already

running. This waits until the instance is done and updates it
automatically.
This commit is contained in:
sheep 2021-11-15 01:44:12 -05:00
parent dd7114a658
commit 72bab1ec6b

24
get_newsboat.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
# Polybar doesn't like it when you do stuff.
loop() {
while true ; do
OUTPUT=$(newsboat -x $1)
if [ $? == 0 ]
then
echo $OUTPUT
break
fi
sleep 1
done
}
case $1 in
update|up)
loop reload
;;
fetch|fe)
loop print-unread | sed 's/ .*/ articles/;s/^/ /'
;;
esac