├── CNAME ├── sounds ├── hat.mp3 ├── derase.mp3 ├── ding.mp3 ├── keyup.mp3 ├── kick.mp3 ├── mbox1.mp3 ├── mbox10.mp3 ├── mbox11.mp3 ├── mbox2.mp3 ├── mbox3.mp3 ├── mbox4.mp3 ├── mbox5.mp3 ├── mbox6.mp3 ├── mbox7.mp3 ├── mbox8.mp3 ├── mbox9.mp3 ├── quack1.mp3 ├── quack2.mp3 ├── snare.mp3 ├── dspark1.mp3 ├── dspark2.mp3 ├── dspark3.mp3 ├── dspark4.mp3 ├── dspark5.mp3 ├── dspark6.mp3 ├── keydown.mp3 ├── newline.mp3 └── keystroke.mp3 ├── .github ├── FUNDING.yml ├── CODEOWNERS ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml ├── mergify.yml ├── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── workflows │ ├── website.yml │ ├── cd.yml │ ├── ci.yml │ └── release.yml ├── assets ├── daktilo-demo.mp4 ├── daktilo-logo.png ├── mac_input_monitoring.png └── mac_terminal_permission.png ├── _config.yml ├── typos.toml ├── CHANGELOG.md ├── .gitignore ├── rustfmt.toml ├── crates ├── daktilo │ ├── src │ │ ├── lib.rs │ │ ├── bin │ │ │ ├── completions.rs │ │ │ └── mangen.rs │ │ ├── args.rs │ │ └── main.rs │ ├── Cargo.toml │ ├── CHANGELOG.md │ └── wix │ │ └── main.wxs └── daktilo_lib │ ├── CHANGELOG.md │ ├── src │ ├── audio.rs │ ├── logger.rs │ ├── embed.rs │ ├── lib.rs │ ├── error.rs │ ├── config.rs │ └── app.rs │ └── Cargo.toml ├── .editorconfig ├── release-plz.toml ├── SECURITY.md ├── deny.toml ├── committed.toml ├── RELEASE.md ├── LICENSE-MIT ├── Cargo.toml ├── cliff.toml ├── config └── daktilo.toml ├── CONTRIBUTING.md ├── CODE_OF_CONDUCT.md ├── LICENSE-APACHE ├── README.md └── Cargo.lock /CNAME: -------------------------------------------------------------------------------- 1 | daktilo.cli.rs 2 | -------------------------------------------------------------------------------- /sounds/hat.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/hat.mp3 -------------------------------------------------------------------------------- /sounds/derase.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/derase.mp3 -------------------------------------------------------------------------------- /sounds/ding.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/ding.mp3 -------------------------------------------------------------------------------- /sounds/keyup.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/keyup.mp3 -------------------------------------------------------------------------------- /sounds/kick.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/kick.mp3 -------------------------------------------------------------------------------- /sounds/mbox1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox1.mp3 -------------------------------------------------------------------------------- /sounds/mbox10.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox10.mp3 -------------------------------------------------------------------------------- /sounds/mbox11.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox11.mp3 -------------------------------------------------------------------------------- /sounds/mbox2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox2.mp3 -------------------------------------------------------------------------------- /sounds/mbox3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox3.mp3 -------------------------------------------------------------------------------- /sounds/mbox4.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox4.mp3 -------------------------------------------------------------------------------- /sounds/mbox5.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox5.mp3 -------------------------------------------------------------------------------- /sounds/mbox6.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox6.mp3 -------------------------------------------------------------------------------- /sounds/mbox7.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox7.mp3 -------------------------------------------------------------------------------- /sounds/mbox8.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox8.mp3 -------------------------------------------------------------------------------- /sounds/mbox9.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/mbox9.mp3 -------------------------------------------------------------------------------- /sounds/quack1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/quack1.mp3 -------------------------------------------------------------------------------- /sounds/quack2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/quack2.mp3 -------------------------------------------------------------------------------- /sounds/snare.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/snare.mp3 -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: orhun 2 | patreon: orhunp 3 | buy_me_a_coffee: orhun 4 | -------------------------------------------------------------------------------- /sounds/dspark1.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/dspark1.mp3 -------------------------------------------------------------------------------- /sounds/dspark2.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/dspark2.mp3 -------------------------------------------------------------------------------- /sounds/dspark3.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/dspark3.mp3 -------------------------------------------------------------------------------- /sounds/dspark4.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/dspark4.mp3 -------------------------------------------------------------------------------- /sounds/dspark5.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/dspark5.mp3 -------------------------------------------------------------------------------- /sounds/dspark6.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/dspark6.mp3 -------------------------------------------------------------------------------- /sounds/keydown.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/keydown.mp3 -------------------------------------------------------------------------------- /sounds/newline.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/newline.mp3 -------------------------------------------------------------------------------- /sounds/keystroke.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/sounds/keystroke.mp3 -------------------------------------------------------------------------------- /assets/daktilo-demo.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/assets/daktilo-demo.mp4 -------------------------------------------------------------------------------- /assets/daktilo-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/assets/daktilo-logo.png -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | # configuration for https://jekyllrb.com/docs/configuration 2 | 3 | theme: jekyll-theme-slate 4 | -------------------------------------------------------------------------------- /assets/mac_input_monitoring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/assets/mac_input_monitoring.png -------------------------------------------------------------------------------- /assets/mac_terminal_permission.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/orhun/daktilo/HEAD/assets/mac_terminal_permission.png -------------------------------------------------------------------------------- /typos.toml: -------------------------------------------------------------------------------- 1 | # configuration for https://github.com/crate-ci/typos 2 | 3 | [default.extend-words] 4 | dum = "dum" 5 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Changelogs are kept separately for each crate in this repository. 4 | 5 | **daktilo** changelog [is now here](./crates/daktilo/CHANGELOG.md). 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled files and executables 2 | /target/ 3 | 4 | # Backup files generated by rustfmt 5 | **/*.rs.bk 6 | 7 | # Binaries that are installed by cargo-run-bin 8 | .bin/ 9 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | # configuration for https://rust-lang.github.io/rustfmt/ 2 | 3 | edition = "2021" 4 | max_width = 100 5 | use_field_init_shorthand = true 6 | use_try_shorthand = true 7 | -------------------------------------------------------------------------------- /crates/daktilo/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Turn your keyboard into a typewriter! 📇 2 | 3 | #![warn(missing_docs)] 4 | 5 | /// CLI argument parser. 6 | /// 7 | /// Needs to be in a lib for completions and mangen. 8 | pub mod args; 9 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # configuration for https://editorconfig.org 2 | 3 | root = true 4 | 5 | [*.rs] 6 | indent_style = space 7 | indent_size = 4 8 | 9 | [args.rs] 10 | indent_size = unset 11 | 12 | [*.yml] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/about-codeowners/ 2 | # for more info about CODEOWNERS file 3 | 4 | # It uses the same pattern rule for gitignore file 5 | # https://git-scm.com/docs/gitignore#_pattern_format 6 | 7 | # Core 8 | * @orhun 9 | -------------------------------------------------------------------------------- /crates/daktilo_lib/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [0.5.1] - 2024-04-10 6 | 7 | ### 🐛 Bug Fixes 8 | 9 | - *(cd)* Update embed locations for release-plz action - ([e9eafb6](https://github.com/orhun/daktilo/commit/e9eafb6669d02868a1949a470cc44a7b223acccd)) 10 | 11 | -------------------------------------------------------------------------------- /release-plz.toml: -------------------------------------------------------------------------------- 1 | # configuration for https://github.com/MarcoIeni/release-plz 2 | 3 | [workspace] 4 | allow_dirty = true 5 | changelog_config = "cliff.toml" 6 | changelog_update = true 7 | dependencies_update = true 8 | git_release_enable = false 9 | git_tag_enable = true 10 | pr_labels = ["release"] 11 | publish_allow_dirty = true 12 | semver_check = false 13 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Description of change 4 | 5 | 6 | 7 | 8 | ## How has this been tested? (if applicable) 9 | 10 | 11 | -------------------------------------------------------------------------------- /crates/daktilo_lib/src/audio.rs: -------------------------------------------------------------------------------- 1 | use crate::error::Result; 2 | use rodio::cpal::traits::HostTrait; 3 | use rodio::DeviceTrait; 4 | 5 | /// Get a list of all available audio devices. 6 | pub fn get_devices() -> Result> { 7 | Ok(rodio::cpal::default_host() 8 | .output_devices()? 9 | .map(|d| (d.name().unwrap_or("Unknown".to_string()), d)) 10 | .collect()) 11 | } 12 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | # Maintain dependencies for Cargo 4 | - package-ecosystem: cargo 5 | directory: "/" 6 | schedule: 7 | interval: daily 8 | open-pull-requests-limit: 10 9 | 10 | # Maintain dependencies for GitHub Actions 11 | - package-ecosystem: github-actions 12 | directory: "/" 13 | schedule: 14 | interval: daily 15 | open-pull-requests-limit: 10 16 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | The following versions are supported with security updates: 6 | 7 | | Version | Supported | 8 | | ------- | ------------------ | 9 | | 0.2.x | :white_check_mark: | 10 | | 0.1.x | :white_check_mark: | 11 | 12 | ## Reporting a Vulnerability 13 | 14 | Please use the [GitHub Security Advisories](https://github.com/orhun/daktilo/security/advisories/new) feature to report vulnerabilities. 15 | -------------------------------------------------------------------------------- /.github/mergify.yml: -------------------------------------------------------------------------------- 1 | pull_request_rules: 2 | - name: Automatic merge for Dependabot pull requests 3 | conditions: 4 | - author=dependabot[bot] 5 | actions: 6 | merge: 7 | method: squash 8 | 9 | - name: Automatic update to the main branch for pull requests 10 | conditions: 11 | - -conflict # skip PRs with conflicts 12 | - -draft # skip GH draft PRs 13 | - -author=dependabot[bot] # skip dependabot PRs 14 | actions: 15 | update: 16 | -------------------------------------------------------------------------------- /deny.toml: -------------------------------------------------------------------------------- 1 | # configuration for https://github.com/EmbarkStudios/cargo-deny 2 | 3 | [licenses] 4 | default = "deny" 5 | unlicensed = "deny" 6 | copyleft = "deny" 7 | confidence-threshold = 0.8 8 | allow = [ 9 | "MIT", 10 | "Apache-2.0", 11 | "Unicode-DFS-2016", 12 | "MPL-2.0", 13 | "ISC", 14 | "BSD-3-Clause", 15 | "Zlib", 16 | ] 17 | 18 | [sources] 19 | unknown-registry = "deny" 20 | unknown-git = "warn" 21 | allow-registry = ["https://github.com/rust-lang/crates.io-index"] 22 | -------------------------------------------------------------------------------- /committed.toml: -------------------------------------------------------------------------------- 1 | # configuration for https://github.com/crate-ci/committed 2 | 3 | # https://www.conventionalcommits.org 4 | style = "conventional" 5 | # allow merge commits 6 | merge_commit = true 7 | # subject is not required to be capitalized 8 | subject_capitalized = false 9 | # subject should start with an imperative verb 10 | imperative_subject = true 11 | # subject should not end with a punctuation 12 | subject_not_punctuated = true 13 | # disable line length 14 | line_length = 0 15 | # disable subject length 16 | subject_length = 0 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 📇 3 | about: Make a suggestion for the project 4 | title: "" 5 | labels: "enhancement" 6 | assignees: "orhun" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | 11 | 12 | 13 | **Describe the solution you'd like** 14 | 15 | 16 | 17 | **Describe alternatives you've considered** 18 | 19 | 20 | 21 | **Additional context** 22 | 23 | 24 | -------------------------------------------------------------------------------- /crates/daktilo_lib/src/logger.rs: -------------------------------------------------------------------------------- 1 | use crate::error::Result; 2 | use tracing::Level; 3 | use tracing_subscriber::EnvFilter; 4 | 5 | /// Initializes the logger with the given default log level. 6 | /// 7 | /// Provide your crate names to enable logging for them. 8 | pub fn init(default_level: Option, mut crates: Vec) -> Result<()> { 9 | crates.push(env!("CARGO_PKG_NAME").to_string()); 10 | let mut env_filter = EnvFilter::builder() 11 | .from_env_lossy() 12 | .add_directive("none".parse()?); 13 | for crate_name in crates { 14 | env_filter = env_filter.add_directive( 15 | format!("{}={}", crate_name, default_level.unwrap_or(Level::INFO)).parse()?, 16 | ); 17 | } 18 | tracing_subscriber::fmt().with_env_filter(env_filter).init(); 19 | Ok(()) 20 | } 21 | -------------------------------------------------------------------------------- /RELEASE.md: -------------------------------------------------------------------------------- 1 | # Creating a Release 2 | 3 | The releases are automated via [`release-plz`](https://github.com/MarcoIeni/release-plz), [`cargo-dist`](https://github.com/axodotdev/cargo-dist) and [GitHub Actions](https://docs.github.com/en/actions). 4 | 5 | 1. `release-plz` creates a pull request for the new releases automatically. So simply merge the [release PR](https://release-plz.ieni.dev/docs/usage/release-pr) for updating the crate versions and changelog. See [#28](https://github.com/orhun/daktilo/pull/28) for an example. 6 | 7 | 2. After the merge, `release-plz` will pick up the new version and automatically create a tag. This will trigger `cargo-dist` and release binaries will be built in via [release workflow](.github/workflows/release.yml). 8 | 9 | 3. Mark the package out-of-date for package managers. 10 | 11 | 4. Announce the release on social platforms. 🥳 12 | -------------------------------------------------------------------------------- /crates/daktilo_lib/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "daktilo_lib" 3 | version = "0.6.0" 4 | description.workspace = true 5 | authors.workspace = true 6 | license.workspace = true 7 | readme.workspace = true 8 | homepage.workspace = true 9 | repository.workspace = true 10 | keywords.workspace = true 11 | categories.workspace = true 12 | edition.workspace = true 13 | rust-version = "1.74.1" 14 | 15 | [features] 16 | audio-tests = [] 17 | 18 | [dependencies] 19 | rdev = { version = "0.5.3", features = ["serialize"] } 20 | rodio = { version = "0.21.1", default-features = false, features = [ 21 | "symphonia-mp3", 22 | ] } 23 | rust-embed = { version = "8.9.0", features = ["debug-embed", "compression"] } 24 | toml = "0.9.10" 25 | fastrand = "2.3.0" 26 | dirs = "6.0.0" 27 | regex = "1.12.2" 28 | serde_regex = "1.1.0" 29 | tokio.workspace = true 30 | serde.workspace = true 31 | thiserror.workspace = true 32 | tracing.workspace = true 33 | tracing-subscriber.workspace = true 34 | 35 | [dev-dependencies] 36 | pretty_assertions.workspace = true 37 | -------------------------------------------------------------------------------- /.github/workflows/website.yml: -------------------------------------------------------------------------------- 1 | name: Build Website 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | permissions: 10 | contents: read 11 | pages: write 12 | id-token: write 13 | 14 | concurrency: 15 | group: "pages" 16 | cancel-in-progress: true 17 | 18 | jobs: 19 | build: 20 | runs-on: ubuntu-latest 21 | steps: 22 | - name: Checkout 23 | uses: actions/checkout@v4 24 | 25 | - name: Make edits 26 | run: sed -i '/^