Generate compose files from portable mappings.
poco takes a simple YAML mapping of trigger sequences to replacement text and
turns it into a native compose file for a target platform. It is written in
Haskell and is currently a work in progress.
poco [-t|--target TARGET] <input.yaml>
Example input file (see also: example.yaml):
"ae": "ä"
"oe": "ö"
"ue": "ü"
"hug": "🫂"
"..": "…"Run poco on the bundled example and compare with the expected output:
stack build
stack exec poco-exe -- example.yaml
diff example.dict <(stack exec poco-exe -- example.yaml)
TARGET |
Output | Status |
|---|---|---|
Cocoa |
DefaultKeyBinding.dict for macOS (default) |
implemented |
XComp |
XCompose file for X11 |
not yet |
Cocoa output deliberately mimics the Python tool
gen-compose. For example,
"hug": "🫂" becomes:
{"§" = {
"h" = {
"u" = {
"g" = ("insertText:", "🫂");
};
};
};}
example.dict shows the full gen-compose output for example.yaml.
It currently differs from poco -t Cocoa output in sorting.
- The current implementation assumes sequence is a prefix of another; but the code doesn't test for this yet.
- The
XComptarget is stubbed out and not yet implemented.