diff options
| author | not_a_robot06 <temporarythrowaway@tutamail.com> | 2025-07-07 17:01:32 +0100 |
|---|---|---|
| committer | not_a_robot06 <temporarythrowaway@tutamail.com> | 2025-07-07 17:01:32 +0100 |
| commit | 5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3 (patch) | |
| tree | 9f38149ec1394705ea95f0c2b7bcd074363fee07 /flashot-make.sh | |
| parent | be35de785e659cc080dd902cf296b5ce270e2e3f (diff) | |
| download | flashot-5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3.tar.gz flashot-5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3.tar.bz2 flashot-5a1dd2e15de2151e29edbc7949f3ddcbbba3e3b3.zip | |
fix README, suppress errors that are irrelevant
Diffstat (limited to 'flashot-make.sh')
| -rwxr-xr-x | flashot-make.sh | 11 |
1 files changed, 4 insertions, 7 deletions
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 |
