diff --git a/README.md b/README.md index cd8cb1a..dae7698 100644 --- a/README.md +++ b/README.md @@ -57,3 +57,5 @@ function ff() { `ff 50 english_1k` This shell function shuffles N words from cached word list, and if given word list doesnt exist it download's it. It runs in loop, but does sleep 1s after each taken test (or interrupted!) so to exit loop just use CTRL+C twice: once to exit fasttyper, second time to exit loop on sleep. + +The above script is avalible for download from doc folder. diff --git a/doc/fasttyper.sh b/doc/fasttyper.sh new file mode 100644 index 0000000..ff6e5f4 --- /dev/null +++ b/doc/fasttyper.sh @@ -0,0 +1,14 @@ +# fasttyper +function ff() { + mkdir -p ~/.cache/fasttyper + local amount="${1:-50}" + local language="${2:-english}" + local sfile=~/.cache/fasttyper/$language + local source_path=https://raw.githubusercontent.com/Miodec/monkeytype/master/static/languages/$language.json + [[ ! -f $sfile ]] && curl -s $source_path | python3 -c "import sys, json; print('\n'.join(json.load(sys.stdin)['words']))" > $sfile + while true + do + shuf -n $amount $sfile | python3 -m fasttyper + sleep 1 + done +}