23 lines
518 B
Bash
Executable File
23 lines
518 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
# Anki review percentage for statusbar
|
|
|
|
num_to_review=200
|
|
|
|
# Get current card count from Anki
|
|
count=$(curl -s localhost:8765 -X POST -d '{"action": "getNumCardsReviewedToday", "version": 6}' | jq '.result')
|
|
|
|
if [ -z "$count" ]
|
|
then
|
|
if [ -s /tmp/anki-reviews ]; then
|
|
true
|
|
else
|
|
echo "-1" > /tmp/anki-reviews
|
|
fi
|
|
else
|
|
echo "$count" > /tmp/anki-reviews
|
|
fi
|
|
|
|
num_reviews=$(cat /tmp/anki-reviews)
|
|
echo -n -e " Reviews: $(python3 -c "print('{:.2%}'.format($num_reviews/$num_to_review))") "
|