A tool to build keyboard packages for a multitude of platforms using a single, simple text file definition. Supported outputs:
- Linux (X11, m17n)
- macOS
- Windows
- ChromeOS
- iOS/iPadOS
- Android
- SVG
- hit-error correction model as an FST, to be used with our spellers
- CLDR keyboard definitions is presently missing, but is in the pipeline
We think it's pretty cool. Documentation (under construction -- how to update).
kbdgen uses convert
which is part of imagemagick
For Mac: brew install imagemagick
For Linux: <pkg-manager> install imagemagick
- get Rust
- clone this repo:
git clone https://github.com/divvun/kbdgen.git
cd kbdgen
cargo install --path .
(this installskbdgen
to the path)
Alternatively - download a precompiled binary from nightly builds:
Extract the archive, and move the binary to somewhere on your $PATH
.
cargo run -- target --bundle-path C:\Projects\Divvun\keyboards\keyboard-sme\sme.kbdgen --output-path C:\KbdgenBuilds\sme_mac macos generate
Let's build an android app. There's two. divvun-dev-keyboard and divvun-keyboard. The former is the unstable one where we do all the testing. The latter one gets pushed to production. Both are deployed as separate apps in google playstore.
Alas, I digress.
We want to build divvun-dev-keyboard. Clone divvun-dev-keyboard.
cd source/divvun
git clone git@github.com:divvun/divvun-dev-keyboard.git
cd ../kbdgen
cargo run -- fetch -b /Users/srdkvr/source/divvun/divvun-dev-keyboard/divvun-dev.kbdgen #fetches deps
cargo run -- target --bundle-path /Users/srdkvr/source/divvun/divvun-dev-keyboard/divvun-dev.kbdgen --output-path ~/source/divvun/android_keyboard android build
Note - you will need imagemagick to run converting of images - so
$ brew install imagemagick@6
$ echo 'export PATH="/opt/homebrew/opt/imagemagick@6/bin:$PATH"' >> ~/.zshrc
Your typical commands are
- ...
android clone
# Clones the base android repository - ...
android generate
# Generates all the layouts and speller configs, but doesn't clone stuff - ...
android build
# Both of the above.
Your
For Android run two commands:
kbdgen target --bundle-path C:\Projects\Divvun\keyboards\keyboard-sme\sme.kbdgen --output-path C:\KbdgenBuilds\sme_android android clone
kbdgen target --bundle-path C:\Projects\Divvun\keyboards\keyboard-sme\sme.kbdgen --output-path C:\KbdgenBuilds\sme_android android generate
This project is licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Fork and PR on Github.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.