A tool to generate QMK firmware keymaps from org-mode files.
go get github.com/richardc/org2qmk
To translate an org-file into a keymap.c
#!/bin/sh
org2qmk examples/ergodone_default.org keymap
A full compile cycle looks like this (assuming qmk in ~/src/qmk_firmware)
#!/bin/sh
QMK=$HOME/src/qmk_firmware
mkdir $QMK/keyboards/ergodone/keymaps/$(whoami)
org2qmk examples/ergodone_default.org keymap > $QMK/keyboards/ergodone/keymaps/$(whoami)/keymap.c
cd $QMK
make ergodone:$(whoami)
The main example file ergodone_default.org translates ergodone:default from the QMK Firmware distribution. It’s also got a bunch of notes on how this is achieved, so may be considered primary documentation for now.
- QMK Firmware the firmware we’re generating keymaps for
- go-org the org-mode parser that this code piggybacks on
- org-mode the mode that takes over your brain
I don’t know if these are really FAQs, but I have asked myself the questions a few times.
I wanted to get some dust out of my system and program something in go. I’d come across org-go when setting up hugo for my blog, and so it seemed like a good library to experiment around. It is.
More importantly, it just didn’t occur to me until I’d written a chunk of this code to write it in elisp. It’d probably be a much simpler and cleaner implementation, so if you do it let me know and I’ll happily link to you.
Sometimes I’m just not lazy enough.
Using the configurator and then versioning the keymap.json is a pretty good workflow, especially if you like browser-based guis.