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:
parent
dd7114a658
commit
72bab1ec6b
24
get_newsboat.sh
Executable file
24
get_newsboat.sh
Executable 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
|
Loading…
Reference in a new issue