A bash script that simulates typewriter-style text output with customizable typing speeds and indentation.
- Variable typing speeds from extremely fast to extremely slow
- Customizable text indentation
- Supports both direct text input and stdin
- Natural-looking random delays between characters
- ANSI color support for error messages
- Handles multi-line text with proper line breaks
# install into /usr/share
cd /usr/share
# Clone the repository
sudo git clone https://github.com/Open-Technology-Foundation/typewriter
# symlink to local bin
sudo ln -fs /usr/share/typewriter/typewriter /usr/local/bin/typewriter
# symlink for lazy typers
sudo ln -fs /usr/share/typewriter/typewriter /usr/local/bin/tw
Or as a one-liner:
sudo sh -c 'cd /usr/share && git clone https://github.com/Open-Technology-Foundation/typewriter && ln -fs /usr/share/typewriter/typewriter /usr/local/bin/typewriter && ln -fs /usr/share/typewriter/typewriter /usr/local/bin/tw'
typewriter [OPTIONS] text||<stdin
-
-s, --speed SPEED
: Set typing speed- Available speeds: xxxfast, xxfast, xfast, vfast, fast, normal, slow, vslow, xslow, xxslow, xxxslow
- Default: normal
-
-i, --indent INDENT
: Indent text by specified number of spaces -
-V, --version
: Display version information -
-h, --help
: Show help message
TW_SPEED If present, specifies SPEED default value (default 'normal')
TW_INDENT If present, specifies INDENT default value (default 0)
Direct text input:
typewriter -s fast "This is a test."
Using stdin:
echo "This is from stdin" | typewriter -s xxfast
With indentation:
typewriter -s slow -i 4 "This is a test with 4-space indent."
# OR
TW_SPEED=fast
TW_INDENT=4
tw "This is a test with 4-space indent."
Multi-line text:
typewriter "First line\nSecond line\nThird line"
Speed | Min Delay (ms) | Max Delay (ms) |
---|---|---|
xxxfast | 0 | 0 |
xxfast | 1 | 3 |
xfast | 3 | 7 |
vfast | 7 | 15 |
fast | 15 | 25 |
normal | 25 | 40 |
slow | 40 | 55 |
vslow | 55 | 70 |
xslow | 70 | 85 |
xxslow | 85 | 95 |
xxxslow | 99 | 99 |
- Bash 5.0 or later
- Linux/Unix environment
- Basic Unix utilities (shuf, printf)
This project is licensed under the GPL3 License - see the LICENSE file for details.
Gary Dean garydean@yatti.id