From 5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3 Mon Sep 17 00:00:00 2001 From: not_a_robot06 Date: Mon, 7 Jul 2025 17:01:32 +0100 Subject: fix README, suppress errors that are irrelevant --- flashot-make.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'flashot-make.sh') diff --git a/flashot-make.sh b/flashot-make.sh index 34c921f..f601a94 100755 --- a/flashot-make.sh +++ b/flashot-make.sh @@ -1,16 +1,12 @@ #!/bin/sh combine() { - for name in $(ls | cut -d- -f1-2 | uniq); do + for name in $(ls | cut -d- -f1-2 | uniq | sed 's/final//'); do magick "$name"-q* -append final/"$name"-0.png magick "$name"-a* -append final/"$name"-1.png done } cards_txt() { - if [ $(ls cards.txt) ]; then - rm cards.txt - fi - for name in $(ls *.png | cut -d- -f1 | uniq); do old_card=-1 for file in "$name"*; do @@ -29,19 +25,20 @@ cards_txt() { if [ -z "$FLASHOT_ANKI_USER" ]; then FLASHOT_ANKI_USER=Main; fi +# main action=$(printf "make flashcards\nreset" | dmenu -i -p "action?") if [ "$action" = "make flashcards" ]; then confirm=$(printf "no\nyes" | dmenu -i -p "are you sure? screenshot names can overwrite others in media folder") if [ "$confirm" = "yes" ]; then + if [ -d /tmp/flashot/final ]; then rm -rf /tmp/flashot/final; fi cd /tmp/flashot mkdir -p final combine cd final cards_txt cp *.png ~/.local/share/Anki2/"$FLASHOT_ANKI_USER"/collection.media/ - anki /tmp/flashot/final/cards.txt + anki /tmp/flashot/final/cards.txt & fi - elif [ "$action" = "reset" ]; then confirm=$(printf "no\nyes" | dmenu -i -p "are you sure? this action cannot be undone") if [ "$confirm" = "yes" ]; then -- cgit v1.2.3