Code Monkey home page Code Monkey logo

typer's Issues

Incorrect measurement of time

For now time is measured from the start of the program, I think to measure WPM correctly it should be measured from the first keystroke.

For now WPM is calculated using equation like this:

(model.Score / charsPerWord) / (time.Since(m.Start).Minutes())

Quote option

Is your feature request related to a problem? Please describe.
Quotations can be used from monkeytype repository using quotes folder instead of languages ​​folder

Describe the solution you'd like
The -q flag can be used with -m

Describe alternatives you've considered

Additional context
I'm planning to create a pr for this

Support special characters

Describe the bug
typer panics with umlauts

To Reproduce
Steps to reproduce the behavior:

  1. run echo "ä" | typer
  2. press any key

Desktop (please complete the following information):

  • OS: Manjaro Linux

Panics if /usr/share/dict/words not found

Describe the bug
Running with no args on arch linux I don't have the "words" package installed. I get a panic. Not a big deal and easily worked around but a clear error message or even a small fallback list of words baked into the exe might be more graceful.

To Reproduce
Steps to reproduce the behavior:
Install typer on arch linux without the "words" package. Run it with no arguments.

Expected behavior
Fall back to some other word list, or print a simple error message.

Screenshots

❯ typer
panic: open /usr/share/dict/words: no such file or directory

goroutine 1 [running]:
github.com/tjarratt/babble.readAvailableDictionary()
        /home/plyons/go/pkg/mod/github.com/tjarratt/[email protected]/babble_unix.go:14 +0x9c
github.com/tjarratt/babble.NewBabbler(...)
        /home/plyons/go/pkg/mod/github.com/tjarratt/[email protected]/babble.go:22
github.com/maaslalani/typer/pkg/utility.RandomWords(0x14)
        /home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/pkg/utility/utility.go:19 +0x6f
github.com/maaslalani/typer/pkg/typer.FromRandom(0xc000010010, 0x6f95c8)
        /home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/pkg/typer/typer.go:54 +0x1e
github.com/maaslalani/typer/cmd.glob..func1(0x94d660, {0x6f6873, 0x0, 0x0})
        /home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/cmd/root.go:58 +0x26b
github.com/spf13/cobra.(*Command).execute(0x94d660, {0xc000012200, 0x0, 0x0})
        /home/plyons/go/pkg/mod/github.com/spf13/[email protected]/command.go:856 +0x5f8
github.com/spf13/cobra.(*Command).ExecuteC(0x94d660)
        /home/plyons/go/pkg/mod/github.com/spf13/[email protected]/command.go:960 +0x3ad
github.com/spf13/cobra.(*Command).Execute(...)
        /home/plyons/go/pkg/mod/github.com/spf13/[email protected]/command.go:897
github.com/maaslalani/typer/cmd.Execute()
        /home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/cmd/root.go:68 +0x25
main.main()
        /home/plyons/go/pkg/mod/github.com/maaslalani/[email protected]/main.go:6 +0x17

Desktop (please complete the following information):

  • OS: arch linux

Additional context
Add any other context about the problem here.

Prodive own UI

Is your feature request related to a problem? Please describe.
I want to use the business logic you have implemented but do not want to use it in the terminal. I want to build my own UI arround the logic

Describe the solution you'd like
I would like an Interface for UI Outputs which can be injected

Does anyone have some suggestions ? I did a quick code check and could not determine a clear seperation from business logic and UI representation. Am I wrong ?

Read text from `stdin` for typing test

Currently typer only allows random words that are generated to be used as the typing test. It would be really nice if a user could provide their own text from a file or piped in from another program.

Example:

curl https://www.random.text/lorem.txt | typer
cat random.txt | typer

scoop pakage

please provide a scoop package for typer .
at window 🙏

Theme colors not working in Ansi256

Describe the bug
Text colors do not work as intended in Ansi256

To Reproduce
Steps to reproduce the behavior:

  1. Use Ansi256 Terminal (e.g. Mac terminal with Settings > Profile > Advanced > Declare terminal as: xterm-256color
  2. Configure colors in ~/.typer.yaml like:
theme:
  bar:
    color: '#555555'
  graph:
    color: purple
    height: 3
  text:
    error:
      foreground: '#FF00000'
      background: '#FFFFFF'
    typed:
      foreground: '#0000FF'
    untyped:
      foreground: '#555555'
  1. run typer

Expected behavior
The configured colors should be approximated for the terminal.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Version [e.g. 22]

Additional context
I think that the termenv color profile should be used when setting the colors. Will make a PR for this. (Also termenv has had several version changes, and could be updated. Happy to do that if desired.)

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.