From 3bdbf82d370c12b6b868f2e2a7b63ee32d6400aa Mon Sep 17 00:00:00 2001 From: Hektor Misplon Date: Wed, 14 Jun 2023 21:18:39 +0200 Subject: [PATCH] Generalize 'sb-anki' to other taskbars --- .bin/sb-anki | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.bin/sb-anki b/.bin/sb-anki index fa4ebc4..c6e2e5e 100755 --- a/.bin/sb-anki +++ b/.bin/sb-anki @@ -10,21 +10,11 @@ then if [ -s /tmp/anki-reviews ]; then true else - echo "0" > /tmp/anki-reviews + echo "-1" > /tmp/anki-reviews fi else echo "$count" > /tmp/anki-reviews fi num_reviews=$(cat /tmp/anki-reviews) - -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" +echo -n -e " Reviews: $(python3 -c "print('{:.2%}'.format($num_reviews/$num_to_review))") "