Generalize 'sb-anki' to other taskbars

master
Hektor Misplon 2023-06-14 21:18:39 +02:00
parent 40236a9461
commit 3bdbf82d37
1 changed files with 2 additions and 12 deletions

View File

@ -10,21 +10,11 @@ then
if [ -s /tmp/anki-reviews ]; then if [ -s /tmp/anki-reviews ]; then
true true
else else
echo "0" > /tmp/anki-reviews echo "-1" > /tmp/anki-reviews
fi fi
else else
echo "$count" > /tmp/anki-reviews echo "$count" > /tmp/anki-reviews
fi fi
num_reviews=$(cat /tmp/anki-reviews) num_reviews=$(cat /tmp/anki-reviews)
echo -n -e " Reviews: $(python3 -c "print('{:.2%}'.format($num_reviews/$num_to_review))") "
if [ "$num_reviews" -ge 400 ];then
color="\x01"
"$(task "Anki reviews" done)" # Check of taskwarrior task
elif [ "$num_reviews" -ge 200 ]; then
color="\x03"
else
color="\x04"
fi
echo -n -e "$color Reviews: $(python3 -c "print('{:.2%}'.format($num_reviews/400))") \x01"