Skip to content

cli tool to generate preview images from a zmk .keymap file

License

Notifications You must be signed in to change notification settings

QuasarX35/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.

cd C:\Users\KZ\Downloads\Installers\zmk-viewer-1.5.0-windows-386
zmk-viewer generate bastardkb/dilemma/3x5_3

Will output this image:

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

Normal

cd C:\Users\KZ\Downloads\Installers\zmk-viewer-1.5.0-windows-386
zmk-viewer generate -f C:\Users\KZ\Desktop\keymap\Klein-zmk\config\boards\shields\klein\klein.keymap bastardkb/dilemma/3x5_3

will output an image for each layer:

Single

cd C:\Users\KZ\Downloads\Installers\zmk-viewer-1.5.0-windows-386
zmk-viewer generate -f C:\Users\KZ\Desktop\keymap\Klein-zmk\config\boards\shields\klein\klein.keymap bastardkb/dilemma/3x5_3 --single

will output one image with all layers:

Unified

cd C:\Users\KZ\Downloads\Installers\zmk-viewer-1.5.0-windows-386
zmk-viewer generate -f C:\Users\KZ\Desktop\keymap\Klein-zmk\config\boards\shields\klein\klein.keymap bastardkb/dilemma/3x5_3 --unified

will output one image with all layers stacked:

About

cli tool to generate preview images from a zmk .keymap file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 88.3%
  • Shell 9.7%
  • Dockerfile 2.0%