From e373f5c47c5f0b7ead90841cce36dcfa161baf7c Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Fri, 10 Feb 2023 14:42:14 +0800 Subject: Update --- X11/openbox/rc.xml | 5 +++++ tools/misc/flash.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100755 tools/misc/flash.sh 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 @@ ~/helper/X11/rofi/rofi-pass + + + 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 + + alacritty -e vim 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 @@ +#! /bin/bash + +CARD="$(cat ~/log/flashcards.md | shuf | head -1)" + +# Print the Question +<<<"$CARD" tr -s '\t' | cut -f1 +echo +echo ---- +echo + +# Get the User Input +read -er INPUT + +# Print the Answer +ANSER=$(<<<"$CARD" tr -s '\t' | cut -f2) +echo +echo ---- +echo + +# If answer correctly, print the checked box +if [[ "$INPUT" == "$ANSER" ]]; then + tput setaf 2 + echo '☑' +else + tput setaf 1 + echo $ANSER +fi + +# Quit when getting Line Feed +read -- cgit v1.2.3-70-g09d2