bump example added to doc for download

This commit is contained in:
Doman 2022-02-03 13:50:58 +01:00
parent 647aa2c714
commit 3dd5d0a8fc
2 changed files with 16 additions and 0 deletions

View file

@ -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.

14
doc/fasttyper.sh Normal file
View file

@ -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
}