Skip to content

MrMarble/zmk-viewer

Repository files navigation

ZMK viewer

GitHub go.mod Go version CodeQL golangci-lint

A work in progress Cli tool to generate preview images from a zmk .keymap file.

Installation

You can download a pre compiled binary directly from the releases for your OS/Architecture.

Linux/MacOS

I made an installation script that should download the latest available version corresponding to your OS and architecture. sudo is needed to copy the binary to /usr/local/bin

curl -sL https://raw.githubusercontent.com/MrMarble/zmk-viewer/master/scripts/install.sh | sudo -E bash -
# or with wget
wget -O - https://raw.githubusercontent.com/MrMarble/zmk-viewer/master/scripts/install.sh | sudo -E bash -

Windows

Download the executable directly from the releases

Others

If you already have Go in your system you can use go install to build the binary without cloning the repo first.

go install github.com/mrmarble/zmk-viewer/cmd/zmk-viewer@latest # or target a specific version @v0.1.0

Usage

Usage: zmk-viewer generate <keyboard-name>

Generate layout image.

Arguments:
  <keyboard-name>    Keyboard name to fetch layout.

Flags:
  -h, --help                  Show context-sensitive help.
  -D, --debug                 Enable debug mode
      --version               Print version information and quit

  -f, --file=STRING           ZMK .keymap file
  -l, --layout-file=STRING    info.json file
  -t, --transparent           Use a transparent background.
  -r, --raw                   Draw the ZMK codes instead of the key labels.
  -s, --single                Generate a single image.
  -u, --unified               Generate a single image with all the layers.
  -o, --output="."            Output directory.

Keyboard name should be the same as in https://config.qmk.fm.

zmk-viewer generate cradio

Will output this image:

You can pass a .keymap file (this one for reference) to generate the layout with bindings

Normal

zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio

will output an image for each layer:

Single

zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio --single

will output one image with all layers:

Unified

zmk-viewer generate -f ~/zmk-config/config/cradio.keymap cradio --unified

will output one image with all layers stacked:

⭐ Stargazers

Star History Chart