diff options
| -rw-r--r-- | X11/openbox/rc.xml | 5 | ||||
| -rwxr-xr-x | tools/misc/flash.sh | 30 |
2 files changed, 35 insertions, 0 deletions
diff --git a/X11/openbox/rc.xml b/X11/openbox/rc.xml index 5e81845..c79394d 100644 --- a/X11/openbox/rc.xml +++ b/X11/openbox/rc.xml | |||
| @@ -599,6 +599,11 @@ | |||
| 599 | <command>~/helper/X11/rofi/rofi-pass</command> | 599 | <command>~/helper/X11/rofi/rofi-pass</command> |
| 600 | </action> | 600 | </action> |
| 601 | </keybind> | 601 | </keybind> |
| 602 | <keybind key="W-q"> | ||
| 603 | <action name="Execute"> | ||
| 604 | <command>alacritty -o "window.padding.x=100" -o "window.padding.y=70" -o "window.dimensions.columns=64" -o "window.dimensions.lines=15" -e ~/helper/tools/misc/flash.sh</command> | ||
| 605 | </action> | ||
| 606 | </keybind> | ||
| 602 | <keybind key="C-A-v"> | 607 | <keybind key="C-A-v"> |
| 603 | <action name="Execute"> | 608 | <action name="Execute"> |
| 604 | <command>alacritty -e vim</command> | 609 | <command>alacritty -e vim</command> |
diff --git a/tools/misc/flash.sh b/tools/misc/flash.sh new file mode 100755 index 0000000..bad8bb1 --- /dev/null +++ b/tools/misc/flash.sh | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #! /bin/bash | ||
| 2 | |||
| 3 | CARD="$(cat ~/log/flashcards.md | shuf | head -1)" | ||
| 4 | |||
| 5 | # Print the Question | ||
| 6 | <<<"$CARD" tr -s '\t' | cut -f1 | ||
| 7 | echo | ||
| 8 | echo ---- | ||
| 9 | echo | ||
| 10 | |||
| 11 | # Get the User Input | ||
| 12 | read -er INPUT | ||
| 13 | |||
| 14 | # Print the Answer | ||
| 15 | ANSER=$(<<<"$CARD" tr -s '\t' | cut -f2) | ||
| 16 | echo | ||
| 17 | echo ---- | ||
| 18 | echo | ||
| 19 | |||
| 20 | # If answer correctly, print the checked box | ||
| 21 | if [[ "$INPUT" == "$ANSER" ]]; then | ||
| 22 | tput setaf 2 | ||
| 23 | echo '☑' | ||
| 24 | else | ||
| 25 | tput setaf 1 | ||
| 26 | echo $ANSER | ||
| 27 | fi | ||
| 28 | |||
| 29 | # Quit when getting Line Feed | ||
| 30 | read | ||