diff options
| -rwxr-xr-x | X11/rofi/pass.edit | 3 | ||||
| -rwxr-xr-x | tools/misc/flash.sh | 49 |
2 files changed, 27 insertions, 25 deletions
diff --git a/X11/rofi/pass.edit b/X11/rofi/pass.edit index 6187ef3..b5698fb 100755 --- a/X11/rofi/pass.edit +++ b/X11/rofi/pass.edit | |||
| @@ -16,6 +16,5 @@ fi | |||
| 16 | 16 | ||
| 17 | # Use detected terminal emulator to edit password | 17 | # Use detected terminal emulator to edit password |
| 18 | coproc ( | 18 | coproc ( |
| 19 | alacritty -e pass edit $1 && pass $1 --clip | 19 | alacritty -e pass edit $1 && $(dirname $0)/pass.get $1 |
| 20 | rofi -e "Copied: $1" | ||
| 21 | ) | 20 | ) |
diff --git a/tools/misc/flash.sh b/tools/misc/flash.sh index bad8bb1..71d81a4 100755 --- a/tools/misc/flash.sh +++ b/tools/misc/flash.sh | |||
| @@ -1,30 +1,33 @@ | |||
| 1 | #! /bin/bash | 1 | #! /bin/bash |
| 2 | 2 | ||
| 3 | CARD="$(cat ~/log/flashcards.md | shuf | head -1)" | 3 | while true; do |
| 4 | CARD="$(cat ~/log/flashcards.md | shuf | head -1)" | ||
| 4 | 5 | ||
| 5 | # Print the Question | 6 | # Print the Question |
| 6 | <<<"$CARD" tr -s '\t' | cut -f1 | 7 | <<<"$CARD" tr -s '\t' | cut -f1 |
| 7 | echo | 8 | echo |
| 8 | echo ---- | 9 | echo ---- |
| 9 | echo | 10 | echo |
| 10 | 11 | ||
| 11 | # Get the User Input | 12 | # Get the User Input |
| 12 | read -er INPUT | 13 | read -er INPUT |
| 13 | 14 | ||
| 14 | # Print the Answer | 15 | # Print the Answer |
| 15 | ANSER=$(<<<"$CARD" tr -s '\t' | cut -f2) | 16 | ANSER=$(<<<"$CARD" tr -s '\t' | cut -f2) |
| 16 | echo | 17 | echo |
| 17 | echo ---- | 18 | echo ---- |
| 18 | echo | 19 | echo |
| 19 | 20 | ||
| 20 | # If answer correctly, print the checked box | 21 | # If answer correctly, print the checked box |
| 21 | if [[ "$INPUT" == "$ANSER" ]]; then | 22 | if [[ "$INPUT" == "$ANSER" ]]; then |
| 22 | tput setaf 2 | 23 | tput setaf 2 |
| 23 | echo '☑' | 24 | echo '☑' |
| 24 | else | 25 | tput setaf 7 |
| 25 | tput setaf 1 | 26 | else |
| 26 | echo $ANSER | 27 | echo $ANSER |
| 27 | fi | 28 | fi |
| 28 | 29 | ||
| 29 | # Quit when getting Line Feed | 30 | echo |
| 30 | read | 31 | echo ---- |
| 32 | echo | ||
| 33 | done | ||