Giter Club home page Giter Club logo

thokr's Introduction

thokr

✨ sleek typing tui with visualized results and historical logging

GitHub Build Workflow GitHub Deploy Workflow License Crate Version Github Stars

demo

Usage

For detailed usage run thokr -h.

thokr 0.4.1
sleek typing tui with visualized results and historical logging

USAGE:
    thokr [OPTIONS]

OPTIONS:
    -f, --full-sentences <NUMBER_OF_SENTENCES>
            number of sentences to use in test

    -h, --help
            Print help information

    -l, --supported-language <SUPPORTED_LANGUAGE>
            language to pull words from [default: english] [possible values: english, english1k,
            english10k]

    -p, --prompt <PROMPT>
            custom prompt to use

    -s, --number-of-secs <NUMBER_OF_SECS>
            number of seconds to run test

    -V, --version
            Print version information

    -w, --number-of-words <NUMBER_OF_WORDS>
            number of words to use in test [default: 15]

Installation

Cargo

$ cargo install thokr

Docker

$ docker run -it thatvegandev/thokr

Arch Linux

Install thokr-git from the AUR

Usage

For detailed usage run thokr -h.

Examples

command test contents
thokr 50 of the 200 most common english words
thokr -w 100 100 of the 200 most common English words
thokr -w 100 -l english1k 100 of the 1000 most common English words
thokr -w 10 -s 5 10 of the 200 most common English words (hard stop at 5 seconds)
thokr -p "$(cat foo.txt)" custom prompt with the output of cat foo.txt
thokr -f 4 4 grammatical sentences with full stops; overrides word settings

During a test you can press ← to start over or → to see a new prompt (assuming you didn't supply a custom one)

Supported Languages

The following languages are available by default:

name description
english 200 most common English words
english1k 1000 most common English words
english10k 10000 most common English words

Logging

Upon completion of a test, a row outlining your results is appended to the log.csv file found in the following platform-specific folders. This way you can easily track your progress over time.

platform value example
Linux $XDGCONFIG_HOME/_project_path or $HOME/.config/project_path /home/colby/.config/thokr
macOS $HOME/Library/Application Support/project_path /Users/Colby/Library/Application Support/thokr
Windows {FOLDERIDRoamingAppData}_project_path\config C:\Users\Colby\AppData\Roaming\thokr\config

Roadmap

  • ⚡️ Performance
    • Right now there are known performance issues surrounding the rendering of the tui at each tick interval and/or key press. Ideally each render uses the prior render as a base and only makes the necessary adjustments (possibly using StatefulWidget), but I haven't been able to figure that out yet.
  • 🔠 Multi-language support
    • I decided not to launch thokr with languages besides english because of some odd rendering issues I was experiencing when trying to input characters with accents. It's as though I'm not able to properly input the character in raw mode. I'd love to have that figure out before shipping other languages because I personally felt the experience was a bit jarring. I'll open an bug report for it with more details and replication steps -- would love more eyes on that problem!
  • 🧪 Tests
    • I've only written a small amount of tests at this point. I haven't sat down to really think through what tests look like when the output is dependent on the users terminal size, font size, etc. If you have any ideas for this please open up an issue and start the discussion!

Contributing

All contributions are greatly appreciated.

If you have a suggestion that would make thokr better, please fork the repo and create a pull request. You can also simply open an issue and select Feature Request

  1. Fork the repo
  2. Create your feature branch (git checkout -b [your_username]/xyz)
  3. Commit your changes (git commit -m 'add some xyz')
  4. Rebase off main (git fetch --all && git rebase origin/main)
  5. Push to your branch (git push origin [your_username]/xyz)
  6. Fill out pull request template

See the open issues for a full list of proposed features (and known issues).

License

Distributed under the MIT License. See LICENSE.md for more information.

Acknowledgments

Check out these amazing projects that inspired thokr!

Follow

github twitter youtube

thokr's People

Contributors

coloradocolby avatar crstian19 avatar dmitr101 avatar merelymyself avatar nickwanninger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

thokr's Issues

continually load new words to meet time limit / scroll lines

Problem

Presently, when you pass -s to set a time limit, the test doesn't run for that amount of time. Instead, it runs until the you've typed all the words(which is 15 by default)

Solution

I really like 60 seconds typing tests and on something like monkeytype, the number of words isn't static - if you're typing fast, it increases the number of words automatically. There are 3 lines and as soon as you complete the 2nd line, a new line of words is added. So you never reach the last line.

This makes more sense to me.

Alternatives

However, I have no clue if doing that is feasible in a terminal. If it isn't, I think doing something similar to →(but without resetting the timer) would be nice.

Of course, I can do something like -s 60 -w 2000 but having so many words displayed at once makes it much more difficult for me to focus.

Caret customization

Hi ! Thanks for creating thokr, i'm having fun playing it in random terminals :)

My only issue is that I struggle noticing where my caret is sometimes (when i'm trying to see whether the key i hit registered or not); the underline is not always visible enough to me.

It would be cool to see an option to use different caret types (block, beam), perhaps even following current terminal settings ! (That could perhaps expand into cool fluff like pace carets like the other issue describes as well).

pace caret

Problem

One of my favorite features of Monkeytype is called the "pace caret":

Displays a second caret that moves at constant speed. The 'average' option averages the speed of last 10 results.

This gives me a good idea of how fast I'm typing in each trial and helps me keep pace.

Solution

A pace caret feature in thokr could include "PB", "average", and "custom" WPM options, and would work just like in Monkeytype.

Alternatives

A live WPM counter could serve a similar purpose but is hard to pay attention to when focusing on typing. Also, it only indicates how fast I'm typing in the moment, and doesn't give me any idea how well I've been doing throughout the entire test (how likely I am to get a PR).

Additional context

Pace caret demo in Monkeytype. The underline caret moves at a consistent 130 WPM, but jumps when I miss a word.

Thokr_pace_caret.mp4

visualize historical test results

Problem

There's no way to visualize historical test data, such as WPM and accuracy.

Solution

I would love to help write some code (in Python, if you're alright with that) to generate graphs that show average WPM and accuracy over time, for example. The logs would have to record the game mode for this to work. Let me know what you think.

Alternatives

A simple statistics summary page could show one's PB for each game mode, total time spent typing, etc.

Additional context

Statistics graph in Monkeytype.

Thokr_graph

Kernel panics when encountering unicode characters in custom prompt.

Description

From looking at the readme it seems like supporting an extended character set is beyond the current scope of this project at the moment. So I feel a bit cheeky making this request. I would love it to work because I'm trying to use thokr as part of practice learning languages.

The program halts when it encounters an extended character (when the user is expected to type that character, before they have done so).

To Reproduce

Enter this command:

thokr -p "ich heiße Thokr"

and type ich hei

Expected behavior

The kernel panics with the following output:



                                                                               ich heithread 'main' panicked at 'byte index 8 is not a char boundary; it is inside 'ß' (bytes 7..9) of `ich heiße Thokr`', /Users/joelle/.cargo/registry/src/index.crates.io-6f17d22bba15001f/thokr-0.4.1/src/ui.rs:92:21
                                                                                                                             note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
                              ⏎                      

Screenshots

Screenshot 2023-07-13 at 13 42 20

Environment

  • OS: Mac OS 12.5
  • Terminal Emulator: Kitty (with Fish)
  • Font: JetBrains mono nerd font
  • Crate version: thokr 0.4.1

Additional context

Fresh warp terminal bug

Description

When I start a fresh terminal and run thokr for the first time it doesn't load any graphic until I run it again

To Reproduce

Run thokr in a fresh warp terminal.

Expected behavior

It's expected that it shows some graphics, isn't it?

Screenshots

first run in a fresh terminal:
image
after retry:
image

video:

Gravacao.de.Tela.2022-06-24.as.07.01.07.mov

Environment

  • OS: macOS Monterey 12.4 (21F79)
  • Terminal Emulator: warp
  • Font: hack (warp default)
  • Thokr Version: 0.4.0

Additional context

I'm not an English speaker so sorry for any language mistake...

In iTerm it runs normally...

Multi-byte codepoints cause panic

Description

When a multiple-byte codepoint is rendered in the prompt, thokr panics and dies.

To Reproduce

Run thokr -p "ä"
Observe the panic.

Expected behavior

Thokr should render the character properly, without panicking.

Environment

  • OS: Devuan GNU/Linux Ceres on amd64
  • Terminal Emulator: gnome-terminal
  • Font: JetBrains Mono Nerd Font
  • Crate version: 0.3.0

Additional context

I suspect the source of the panic can be found on line 64 in thok.rs.
https://github.com/thatvegandev/thokr/blob/9453468032cae753570b660146103abd55609df2/src/thok.rs#L64

(t)weet doesn't work in Docker container

Description

After running a typing test and pressing t, nothing happens.

To Reproduce

  1. Run in Docker (docker run -it coloradocolby/thokr)
  2. Complete a typing test
  3. Press t

Expected behavior

I would expect some sort of Twitter-friendly text to copy paste or Twitter opens up with the tweet pre-filled.

Environment

  • OS: macOS
  • Terminal Emulator: xterm
  • Crate version: 0.1.0

Problem with custom prompt

Description

I have a test file with around 50 words that have this structure : (word in each line with no space at the end)

dependencies
visualization
description
parse
duplicates
possible
nootropics
scissors

now when i run thokr -p "$(cat Notes/typing/words)" the app show like this : ( wiht no spaces between words)

dependenciesvisualizationdescriptionparseduplicatespossible
nootropicsscissors

To Reproduce

I tried to add space after each word in the text file and it worded almost : the problem i had is that i need to type twice for each

Expected behavior

To show the words with spaces

Environment

  • OS: Linux Fedora 36 KDE
  • Terminal Emulator: kitty
  • Font: JetBrainsMono Nerd Font
  • Thokr Version: 0.3.0

ctrl+backspace to delete last word

Problem

When I press Ctrl+Backspace, I'd expect the last word to be deleted – this is the behavior of most text input boxes, and Monkeytype. Instead, it adds a new character.

Solution

I don't know exactly how to implement this feature. It could be an optional argument in the CLI.

Additional context

Video demonstrating the behavior. I mistype the word "possible" and attempt to delete the whole word.

Thokr_ctrl+backspace.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.