Code Monkey home page Code Monkey logo

tt's Introduction

What

A terminal based typing test.

Installation

Linux

sudo curl -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt-linux -o /usr/local/bin/tt && sudo chmod +x /usr/local/bin/tt
sudo curl -o /usr/share/man/man1/tt.1.gz -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt.1.gz

OSX

mkdir -p /usr/local/bin /usr/local/share/man/man1 # Usually created by brew

sudo curl -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt-osx -o /usr/local/bin/tt && sudo chmod +x /usr/local/bin/tt
sudo curl -o /usr/local/share/man/man1/tt.1.gz -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt.1.gz

Uninstall

sudo rm /usr/local/bin/tt /usr/share/man/man1/tt.1.gz

From source

# debian dependencies
sudo apt install golang

# clone and make
git clone https://github.com/lemnos/tt
cd tt
make && sudo make install

Best served on a terminal with truecolor and cursor shape support (e.g kitty, iterm)

Usage

By default 50 words from the top 1000 words in the English language are used to constitute the test. Custom text can be supplied by piping arbitrary text to the program. Each paragraph in the input is shown as a separate segment of the text. See man tt or man.md for a complete description and a comprehensive set of options.

Keys

  • Pressing escape at any point restarts the test.
  • C-c exits the test.
  • right moves to the next test.
  • left moves to the previous test.

Examples

  • tt -quotes en Starts quote mode with the builtin quote list 'en'.
  • tt -n 10 -g 5 produces a test consisting of 50 randomly drawn words in 5 groups of 10 words each.
  • tt -t 10 starts a timed test lasting 10 seconds.
  • tt -theme gruvbox Starts tt with the gruvbox theme.

tt is designed to be easily scriptable and integrate nicely with other *nix tools. With a little shell scripting most features the user can conceive of should be possible to implement. Below are some simple examples of what can be achieved.

  • shuf -n 40 /usr/share/dict/words|tt Produces a test consisting of 40 random words drawn from your system's dictionary.
  • curl http://api.quotable.io/random|jq '[.text=.content|.attribution=.author]'|tt -quotes - Produces a test consisting of a random quote.
  • alias ttd='tt -csv >> ~/wpm.csv' Creates an alias called ttd which keeps a log of progress in your home directory`.

The default behaviour is equivalent to tt -n 50.

See -help for an exhaustive list of options.

Configuration

Custom themes and word lists can be defined in ~/.tt/themes and ~/.tt/words and used in conjunction with the -theme and -words flags. A list of preloaded themes and word lists can be found in words/ and themes/ and are accessible by default using the respective flags.

tt's People

Contributors

aulonsal avatar bwoznicki avatar falcucci avatar gaodean avatar k2on avatar lemnos avatar precondition avatar seerlite avatar tusqasi 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  avatar  avatar  avatar

tt's Issues

make install fails on OS X

> sudo make install
Password:

install -Dm755 bin/tt -t /usr/local/bin
install: illegal option -- D
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
make: *** [install] Error 64

This is on OSX 10.15.7 with go version go1.16.5 darwin/amd64 installed via brew. It doesn't look like the OSX version of install has a -D option, so maybe this could be done with mkdir -p instead?

[Feature Request] A way to repeat the test

It would be nice to be able to repeat the exact same (sub-)test to work on accuracy, strive for a better WPM, etc.

I know that Esc "restarts the test" but in the case of random words, it generates a totally new set of words than what you were previously typing and in the case of fed-in text, it puts you back at the very first paragraph, regardless of what paragraph you were on when you pressed Esc.

In this regard, I like wpm's navigation: space and arrows to move through (sub-)tests and esc to restart.

Feature Request: Support Multiline

Description

I suggest adding the ability to handle multiple lines of text as input in "tt." Currently, only individual words and sentences are accepted for typing practice.

Benefits

This enhancement will allow users to practice typing larger blocks of text, such as code snippets, paragraphs, or multiline quotes, making "tt" more versatile and useful for various users.

Implementation

The program should accept multiline input from command-line arguments, files, and STDIN, considering each paragraph as a distinct segment in the typing test.

Example

Poem Title: Dreams

Hold fast to dreams
For if dreams die
Life is a broken-winged bird
That cannot fly.

Hold fast to dreams
For when dreams go
Life is a barren field
Frozen with snow.

hey

it great , thanks u for this

[Feature Request] Add Options to change the font size

It would be nice to allow for user to set a font size. Especially since current size is quite small for me.

I know that there is the default terminal font size changer but it would be nice if there was a custom option within the command to change font-size

1000en does not appear to be a valid word list

Hello, I am on Windows, and I first built "tt" from the source. When I tried running it, I received the following error:
ERROR: 1000en does not appear to be a valid word list. See '-list words' for a list of built-in word lists.

I attempted to use -list words, and it displayed all the built-in words, including 1000en.

Next, I tried downloading "tt" from GitHub releases, but unfortunately, I encountered the same issue.
I am not entirely sure if I am missing something, and I would appreciate any assistance.

Functional: Docker install

Thank you for the application.

Please can you try to make a docker install of the program, that would be very good

"ERROR: failed to read /Users/username/en" on macOSX arm64

tt gives this error saying there should be an "en" file in the home directory. Everything worked when first installed then without any reason this error started appearing. I uninstalled tt then reinstalled and still the same error. I think the issue is tt looking for the words/quotes list in the wrong directory.

Weird Accuracy

Hey there,
I noticed that the accuracy is calculated based of the amount on wrong characters when you finish typing the line - The problem with this is, that you always get an accuracy Value of 100% if you correct your mistakes - Is that intended?
Thanks!

permanent location for test.log

whenever im running the tt command,
its creating a test.log file in that location

it will better if there is a permanent location for test.log file like ~/.tt/test.log

on macOS, am getting: Warning: Failed to create the file /usr/share/man/man1/tt.1.gz: Operation not

On macOS, this give an error:
sudo curl -o /usr/share/man/man1/tt.1.gz -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt.1.gz

example:

$ sudo curl -o /usr/share/man/man1/tt.1.gz -L https://github.com/lemnos/tt/releases/download/v0.4.2/tt.1.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   615  100   615    0     0     98      0  0:00:06  0:00:06 --:--:--   153
Warning: Failed to create the file /usr/share/man/man1/tt.1.gz: Operation not 
Warning: permitted
 65  2142   65  1410    0     0    209      0  0:00:10  0:00:06  0:00:04   209
curl: (23) Failed writing body (0 != 1410)

pip install failing on Windows

Python version 3.9.13. Windows 10 and 11,

When running pip install tt, I get the following error:

# more above

      tt\cross\rectcross\rect_maxvol\cython_boost\maxvol.pyx:225:13: Cannot assign type 'double' to 'int'

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  tmp = abs(coef[k])
                  if tmp > abs_max:
                      abs_max = tmp
                      j = k
              max_value = coef[j]
              i = j/N
                   ^
      ------------------------------------------------------------

      tt\cross\rectcross\rect_maxvol\cython_boost\maxvol.pyx:356:13: Cannot assign type 'double' to 'int'

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  tmp = abs(coef[k])
                  if tmp > abs_max:
                      abs_max = tmp
                      j = k
              max_value = coef[j]
              i = j/N
                   ^
      ------------------------------------------------------------

      tt\cross\rectcross\rect_maxvol\cython_boost\maxvol.pyx:487:13: Cannot assign type 'double' to 'int'

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
                  tmp = abs(coef[k])
                  if tmp > abs_max:
                      abs_max = tmp
                      j = k
              max_value = coef[j]
              i = j/N
                   ^
      ------------------------------------------------------------

      tt\cross\rectcross\rect_maxvol\cython_boost\maxvol.pyx:618:13: Cannot assign type 'double' to 'int'
      error: 4 errors while compiling 'tt\\cross\\rectcross\\rect_maxvol\\cython_boost\\maxvol.pyx' with Cython
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for tt
  Running setup.py clean for tt
Failed to build tt
ERROR: Could not build wheels for tt, which is required to install pyproject.toml-based projects

request a new release

Have some build with go1.19 for 0.4.2 release, but the master builds out fine with go1.19. Thanks!

Punctuation

Thank you for this wonderful tool. I was wondering if we might request the feature of adding random common punctuation to word lists, e.g. tt -n 10. So things like periods, commas, semi-colons, etc.

[Feature Request] Show word count and the duration of the test in the report.

Now the information shown in the report is very limited, only WPM, CPM, accuracy, mistakes and attribution in -quotes.
I have some text files having paragraphs exceeded thousand characters, which takes a lot of time to complete the test.
I would like to know the duration that I performed the test, but I do not want to manually count the words in the previous paragraph and do the math ( word count / WPM), or start a counter when I start a test.

some of the quotes have missing symbols (�) that can't be displayed. Ubuntu 22.04, tt v0.4.2

quotes like the following show up:

                WPM:         50                                             
                CPM:         252                                            
                Accuracy:    97.65%                                         
                Mistakes:    effort�not, intelligence�is                    
                                                                            
                Attribution: Winston Churchill                              

They have some symbols that I find annoying because they mark some errors on my runs.
I tried to check the quotes file, but the text editor warned me not to edit it because it contained unknown symbols, probably related to them. Some quotes also have missing spaces after punctuation and are most annoyingly repeated on the file, appearing more commonly; if you could fix that file, it would be appreciated.

My terminal is Gnome 42 Terminal v3.44.0 with Unicode UTF-8 Encoding.

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.