Daktilo
Turn your keyboard into a typewriter! π
Install / Use
/learn @orhun/DaktiloREADME
<a href="https://github.com/orhun/daktilo/releases"><img src="https://img.shields.io/github/v/release/orhun/daktilo?style=flat&labelColor=1D272B&color=819188&logo=GitHub&logoColor=white" alt="GitHub Release"></a> <a href="https://crates.io/crates/daktilo/"><img src="https://img.shields.io/crates/v/daktilo?style=flat&labelColor=1D272B&color=819188&logo=Rust&logoColor=white" alt="Crate Release"></a> <a href="https://codecov.io/gh/orhun/daktilo"><img src="https://img.shields.io/codecov/c/gh/orhun/daktilo?style=flat&labelColor=1D272B&color=819188&logo=Codecov&logoColor=white" alt="Coverage"></a> <br> <a href="https://github.com/orhun/daktilo/actions?query=workflow%3A%22Continuous+Integration%22"><img src="https://img.shields.io/github/actions/workflow/status/orhun/daktilo/ci.yml?branch=main&style=flat&labelColor=1D272B&color=819188&logo=GitHub%20Actions&logoColor=white" alt="Continuous Integration"></a> <a href="https://github.com/orhun/daktilo/actions?query=workflow%3A%22Release%22"><img src="https://img.shields.io/github/actions/workflow/status/orhun/daktilo/release.yml?style=flat&labelColor=1D272B&color=819188&logo=GitHub%20Actions&logoColor=white&label=release" alt="Continuous Deployment"></a> <a href="https://docs.rs/daktilo/"><img src="https://img.shields.io/docsrs/daktilo?style=flat&labelColor=1D272B&color=819188&logo=Rust&logoColor=white" alt="Documentation"></a>
<video src="https://github.com/orhun/daktilo/assets/24392180/b2b0d9c5-422f-401d-a25d-e6bc797d8976" alt="daktilo demo"> </div>daktilo ("typewriter" in Turkish, pronounced "duck-til-oh", derived from the Ancient Greek word δάκΟΟ Ξ»ΞΏΟ for "finger") is a small command-line program that plays typewriter sounds every time you press a key. It also offers the flexibility to customize keypress sounds to your liking. You can use the built-in sound presets to create an enjoyable typing experience, whether you're crafting emails or up to some prank on your boss.
β¨ Inspiration: "Taking notes in class with my typewriter"
Now you can recreate this moment without the actual need for a physical typewriter!
<details> <summary>Table of Contents</summary> <!-- vim-markdown-toc GFM -->- Getting Started
- Supported Platforms
- Installation
- Usage
- Configuration
- Similar Projects
- MacOS permissions
- Acknowledgements
- Donations
- Contributing
- License
- Copyright
Getting Started
Simply run daktilo for the classic typewriter effect.
There are also different presets available:
| Preset Name | Description |
| ----------- | ----------------------------------------------- |
| default | the classic typewriter effect |
| basic | an alternative and more basic typewriter effect |
| musicbox | plays random notes like a music box |
| ducktilo | quack quack π¦ |
| drumkit | dum, tss, cha! π₯ |
| spark | high voltage high current typing experience β‘ |
To list the presets:
daktilo --list-presets
To use a preset:
daktilo --preset musicbox
You can also use multiple presets at the same time:
# orchestra
daktilo -p default -p musicbox -p drumkit
To use a different output device:
daktilo --device pipewire
Also, you can use --list-devices to list the available output devices.
To variate the sounds and have a more realistic typewriter experience:
daktilo --variate-tempo 0.9,0.4 --variate-volume 0.1,0.5
<details>
<summary>Spoiler warning</summary>
There are easter eggs. If that is something you do not like you can disable them either via the config file option no_surprises = true or using the command-line flag:
daktilo --no-surprises
</details>
Supported Platforms
- [x] Linux
- [x] X11
- [ ] Wayland*
- [x] Windows
- [x] MacOS
Installation
Cargo
daktilo can be installed from crates.io using cargo if Rust is installed.
cargo install daktilo
The minimum supported Rust version is 1.70.0.
On Linux, the following packages should be installed:
- Arch Linux:
alsa-lib libxtst libxi - Alpine Linux:
alsa-lib-dev libxi-dev libxtst-dev - Debian/Ubuntu:
libasound2-dev libxi-dev libxtst-dev
Arch Linux
daktilo can be installed from the official repositories using pacman:
pacman -S daktilo
Alpine Linux
daktilo is available for Alpine Edge. It can be installed via apk after enabling the testing repository.
apk add daktilo
MacPorts
On macOS, daktilo can be installed via MacPorts:
sudo port install daktilo
More info here.
Binary releases
See the available binaries for different targets from the releases page.
Build from source
- Clone the repository.
git clone https://github.com/orhun/daktilo && cd daktilo/
- Build.
CARGO_TARGET_DIR=target cargo build --release
Binary will be located at target/release/daktilo.
Usage
daktilo [OPTIONS]
Options:
-v, --verbose Enables verbose logging [env: VERBOSE=]
-p, --preset [<PRESET>...] Sets the name of the sound preset to use [env: PRESET=]
-l, --list-presets Lists the available presets
--list-devices Lists the available output devices
-d, --device <DEVICE> Sets the device for playback [env: DAKTILO_DEVICE=]
-c, --config <PATH> Sets the configuration file [env: DAKTILO_CONFIG=]
-i, --init Writes the default configuration file
--variate-volume <PERCENT_UP[,PERCENT_DOWN]> Variate volume +/- in percent [env: DAKTILO_VOLUME=]
--variate-tempo <PERCENT_UP[,PERCENT_DOWN]> Variate tempo +/- in percent [env: DAKTILO_TEMPO=]
-h, --help Print help (see more with '--help')
-V, --version Print version
Configuration
daktilo can be configured with a configuration file using the TOML format.
The path of the configuration file can be specified via --config argument or DAKTILO_CONFIG environment variable.
It can also be placed in one of the following global locations:
<config_dir>/daktilo.toml<config_dir>/daktilo/daktilo.toml<config_dir>/daktilo/config
<config_dir> depends on the platform as shown in the following table:
| Platform | Value | Example |
| -------- | ------------------------------------- | ---------------------------------------- |
| Linux | $XDG_CONFIG_HOME or $HOME/.config | /home/orhun/.config |
| macOS | $HOME/Library/Application Support | /Users/Orhun/Library/Application Support |
| Windows | {FOLDERID_RoamingAppData} | C:\Users\Orhun\AppData\Roaming |
See daktilo.toml for the default configuration options.
You can also create the default configuration file in the current directory with --init flag:
daktilo --init
Adding custom presets
The configuration file consists of an array of sound_preset entries.
To define an array in TOML, you can create different sections as follows:
[[sound_preset]]
name = "custom"
key_config = []
[[sound_preset]]
name = "another_custom"
key_config = []
disabled_keys = []
variation = { volume: [0.1, 0.1], tempo: [0.05, 0.05] }
As shown above, sound_preset consists of 2 entries:
name: The name of the preset. It will be used in conjunction with--presetflag. e.g.--preset customkey_config: An array of key press/release events for assigning audio files to the specified keys. It can also be used to control the volume etc.disabled_keys: An array of keys that will not be used for playback.variation: Variate the sound on each event forkey_configs that do not specify variations*
Alt, AltGr, Backspace, CapsLock, ControlLeft, ControlRight, Delete, DownArrow, End, Escape, `F
