jackson15j / zmk-config

ZMK Config for the custom programmable keyboards that I have.
0 stars 0 forks source link

+OPTIONS: \n:nil toc:nil num:nil html-postamble:nil

+PROPERTY: header-args:shell :prologue "exec 2>&1" :epilogue ":" :results drawer :async

My personal ZMK CONFIG's for my keyboards.

** Docker:

Distilled from: [[https://zmk.dev/docs/development/setup][ZMK Docs: Toolchain Setup]] and [[https://zmk.dev/docs/development/build-flash][ZMK Docs: Building and Flashing]].

*** Org codeblock to initialise the =zmk= docker container:

+BEGIN_SRC shell :var zmk_path="../zmk"

echo "- Get ZMK source to mount into container..." git clone https://github.com/zmkfirmware/zmk.git $zmk_path || true cd $zmk_path git pull cd -

echo "- Initialise a Docker Container that will be modified..." docker run --name zmk -v $PWD/$zmk_path/app/:/app -v $PWD:/zmk-config zmkfirmware/zmk-build-arm:stable sleep infinity

docker stop zmk docker start zmk

echo "- Initial setup in the container..." docker exec zmk west init -l /app docker exec zmk west update docker exec zmk west zephyr-export

echo "- Install LSP Server (clangd) for emacs..." docker exec zmk apt-get update docker exec zmk apt-get -y install clangd

+END_SRC

*** Org codeblock to build firmware's in the =zmk= docker container:

+BEGIN_SRC shell :var zmk_path="../zmk"

echo "- Subsequent builds in the container..." docker exec zmk west build -p -s /app -d /app/build/cradio/left/ --board nice_nano -- -DSHIELD=cradio_left -DZMK_CONFIG=/zmk-config/config docker exec zmk west build -p -s /app -d /app/build/cradio/right/ --board nice_nano -- -DSHIELD=cradio_right -DZMK_CONFIG=/zmk-config/config docker exec zmk west build -p -s /app -d /app/build/ferris --board ferris_rev02 -- -DZMK_CONFIG=/zmk-config/config

echo "- Copy files to root of build/ ..." docker exec zmk rm -rf /app/build/.uf2 /app/build/.bin || true docker exec zmk cp /app/build/cradio/left/zephyr/zmk.uf2 /app/build/cradio_left.uf2 docker exec zmk cp /app/build/cradio/right/zephyr/zmk.uf2 /app/build/cradio_right.uf2 docker exec zmk cp /app/build/ferris/zephyr/zmk.bin /app/build/ferris.bin

echo "- SymLink one of the compile_commands.json to satisfy clangd lsp + eglot in emacs..." docker exec zmk ln -sf /app/build/craidio/right/compile_commands.json /zmk-config/.

+END_SRC

** flashing:

Pre-reqs:

USB Storage devices (eg. nice!nano):