Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
michalrom089 committed Jan 3, 2025
1 parent 0659ec9 commit 4019205
Show file tree
Hide file tree
Showing 6 changed files with 632 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build-inputs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

name: 'Build Inputs'
on:
push:
branches:
- main
workflow_dispatch:
inputs:
board:
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/keymap-drawer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# keymap -c config/config_keymap-drawer.yaml parse -c 12 -z config/corne.keymap > keymap-drawer/corne.yaml
# keymap -c config/config_keymap-drawer.yaml draw keymap-drawer/corne.yaml > keymap-drawer/corne.svg

# Example for using the keymap-drawer ZMK user config workflow
name: Draw ZMK keymaps
on:
workflow_dispatch: # can be triggered manually
push: # automatically run on changes to following paths
paths:
- "config/*.keymap"
- "config/config_keymap-drawer.yaml"
- .github/workflows/keymap-drawer.yaml

jobs:
draw:
uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main
permissions:
contents: write # allow workflow to commit to the repo
with:
amend_commit: true
keymap_patterns: "config/*.keymap" # path to the keymaps to parse
config_path: "config/config_keymap-drawer.yaml" # config file, ignored if not exists
output_folder: "keymap-drawer" # path to save produced SVG and keymap YAML files
parse_args: "" # map of extra args to pass to `keymap parse`, e.g. "corne:'-l Def Lwr Rse' cradio:''"
draw_args: "" # map of extra args to pass to `keymap draw`, e.g. "corne:'-k corne_rotated' cradio:'-k paroxysm'"
324 changes: 324 additions & 0 deletions keymap-drawer/config_keymap-drawer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,324 @@
draw_config:
append_colon_to_layer_header: true
arc_radius: 6.0
arc_scale: 1.0
combo_h: 26.0
combo_w: 28.0
inner_pad_h: 2.0
inner_pad_w: 2.0
key_h: 56.0
key_rx: 6.0
key_ry: 6.0
key_w: 60.0
line_spacing: 1.2
outer_pad_h: 56.0
outer_pad_w: 30.0
small_pad: 2.0
split_gap: 30.0
svg_style: |
/* font and background color specifications */
svg {
font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,monospace;
font-size: 14px;
font-kerning: normal;
text-rendering: optimizeLegibility;
fill: #24292e;
}
/* default key styling */
rect {
fill: #f6f8fa;
stroke: #c9cccf;
stroke-width: 1;
}
/* color accent for combo boxes */
rect.combo {
fill: #cdf;
}
/* color accent for held keys */
rect.held, rect.combo.held {
fill: #fdd;
}
/* color accent for ghost (optional) keys */
rect.ghost, rect.combo.ghost {
fill: #ddd;
}
text {
text-anchor: middle;
dominant-baseline: middle;
}
/* styling for layer labels */
text.label {
font-weight: bold;
text-anchor: start;
stroke: white;
stroke-width: 2;
paint-order: stroke;
}
/* styling for combo tap, and key hold/shifted label text */
text.combo, text.hold, text.shifted {
font-size: 11px;
}
text.hold {
text-anchor: middle;
dominant-baseline: auto;
}
text.shifted {
text-anchor: middle;
dominant-baseline: hanging;
}
/* styling for hold/shifted label text in combo box */
text.combo.hold, text.combo.shifted {
font-size: 8px;
}
/* styling for combo dendrons */
path {
stroke-width: 1;
stroke: gray;
fill: none;
}
parse_config:
assign_combos_to_layers: false
preprocess: true
qmk_keycode_map:
AMPERSAND: '&'
AMPR: '&'
ASTERISK: '*'
ASTR: '*'
AT: '@'
BACKSLASH: \
BSLS: \
CIRC: ^
CIRCUMFLEX: ^
COLN: ':'
COLON: ':'
COMM: ','
COMMA: ','
DLR: $
DOLLAR: $
DOT: .
DOUBLE_QUOTE: '"'
DQT: '"'
DQUO: '"'
EQL: '='
EQUAL: '='
EXCLAIM: '!'
EXLM: '!'
GRAVE: '`'
GRV: '`'
GT: '>'
HASH: '#'
LABK: <
LBRC: '['
LCBR: '{'
LEFT_ANGLE_BRACKET: <
LEFT_BRACKET: '['
LEFT_CURLY_BRACE: '{'
LEFT_PAREN: (
LPRN: (
LT: <
MINS: '-'
MINUS: '-'
'NO': ''
NONUS_HASH: '#'
NUHS: '#'
PERC: '%'
PERCENT: '%'
PIPE: '|'
PLUS: +
QUES: '?'
QUESTION: '?'
QUOT: ''''
QUOTE: ''''
RABK: '>'
RBRC: ']'
RCBR: '}'
RIGHT_ANGLE_BRACKET: '>'
RIGHT_BRACKET: ']'
RIGHT_CURLY_BRACE: '}'
RIGHT_PAREN: )
RPRN: )
SCLN: ;
SEMICOLON: ;
SLASH: /
SLSH: /
TILD: '~'
TILDE: '~'
TRANSPARENT: ''
TRNS: ''
UNDERSCORE: _
UNDS: _
SPACE:
raw_binding_map:
'&mm_grescm': {t: '⎋', s: '` ~'}
'&mm_shift_caps_word_l': {t: '⇧', s: ' ', h: ' '}
'&mm_shift_caps_word_r': {t: '⇧', s: ' ', h: ' '}
'&mm_bspc_del': {t: '⌫', s: '⌦'}
'&mm_grescm_gui': {t: ⎋, h: ⌘, s: '~ `'}
'&mm_spc_unds_layer': {t: '⎵', h: 'SYM', s: '_ -'}
'&mm_plus_minus': {t: '+', s: '-'}
'&mm_grave_caret': {t: '`', s: '^'}
'&mm_bracket_r': {t: '(', s: ')'}
'&mm_comma_semi_meh': {t: ',', s: ';', h: 'MEH'}
'&mm_dot_colon': {t: '.', s: ':'}
'&mm_none_undo': ''
'&mm_left_word_cut': ''
'&mm_up_save': ''
'&mm_down_copy': ''
'&mm_none_paste': ''
'&mm_1_cut': '1'
'&mm_2_copy': '2'
'&mm_5_save': '5'
'&swapper_cmd_tab': {t: '⌘↹'}
'&td_at_email': {t: '@'}
'&num_word': 'NUM'
'&nav_word': 'NAV'
'&caps_word_capslock': "Caps\nWord"
'&caps_word': ''
'&td_shift_l': ''
'&td_shift_r': ''
'&td_nav_layer': {t: '⏎', h: 'NAV'}
'&td_bt_clear': 'BT CLR'
'&m_type_md_code_block': '```'
'&kt LSHFT': "\nLock"
'&num_word 6': {t: "Num\nWord", h: ""}
'&lt_num_word 4 0': {t: "Num\nWord", h: ''}
'&ltog LGUI 5': {t: "Cancel\nNav", h: '⌘'}
'&ltog LGUI 6': {t: "Cancel\nNum", h: '⌘'}
'&ltog LGUI 7': {t: "Cancel\nSym", h: '⌘'}
'&ltog LGUI 8': {t: "Cancel\nFunc", h: '⌘'}
'&ltog LGUI 9': {t: "Cancel\nAdjust", h: '⌘'}
'&trans': {t: ' '}
skip_binding_parsing: false
zmk_keycode_map:
BSPC: ''
DEL: ''
AMPERSAND: '&'
AMPS: '&'
APOS: .
APOSTROPHE: <
ASTERISK: '*'
ASTRK: '*'
AT: '@'
AT_SIGN: '@'
BACKSLASH: {t: '\', s: '|'}
BSLH: \
CARET: ^
COLON: ':'
COMMA: {t: ',', s: '<'}
DLLR: $
DOLLAR: $
DOT: {t: '.', s: '>'}
DOUBLE_QUOTES: '"'
DQT: '"'
EQUAL: {t: '=', s: '+'}
EXCL: '!'
EXCLAMATION: '!'
FSLH: /
GRAVE: {t: '`', s: '~'}
GREATER_THAN: '>'
GT: '>'
HASH: '#'
LBKT: {t: '[', s: '{'}
LBRC: '{'
LEFT_BRACE: '{'
LEFT_BRACKET: '['
LEFT_PARENTHESIS: (
LESS_THAN: <
LPAR: (
LT: <
MINUS: {t: '-', s: '_'}
NON_US_BACKSLASH: \
NON_US_BSLH: '|'
NON_US_HASH: '#'
NUHS: '#'
PERCENT: '%'
PERIOD: .
PIPE: '|'
PIPE2: '|'
PLUS: +
POUND: '#'
PRCNT: '%'
QMARK: '?'
QUESTION: '?'
RBKT: {t: ']', s: '}'}
RBRC: '}'
RIGHT_BRACE: '}'
RIGHT_BRACKET: ']'
RIGHT_PARENTHESIS: )
RPAR: )
SEMI: {t: ';', s: ':'}
SEMICOLON: {t: ';', s: ':'}
SINGLE_QUOTE: {t: '''', s: '"'}
SLASH: {t: '/', s: '?'}
SQT: ''''
STAR: '*'
TILDE: '~'
TILDE2: '~'
UNDER: _
UNDERSCORE: _
LCTRL:
LALT:
LGUI:
LSHFT:
RCTRL:
LEFT_CONTROL:
LEFT_ALT:
LEFT_GUI:
LEFT_SHFT:
RALT:
RGUI:
RSHFT:
RIGHT_CONTROL:
RIGHT_ALT:
RIGHT_GUI:
RIGHT_SHFT:
LEFT:
RIGHT:
UP:
DOWN:
TAB:
RETURN: ''
ESCAPE: ''
C_REWIND: ''
C_FAST_FORWARD: ''
C_PAUSE: ''
C_MUTE: "VOL\nMUTE"
C_VOLUME_DOWN: "VOL\nDOWN"
C_VOLUME_UP: "VOL\nUP"
C_BRIGHTNESS_DEC: '☀↓'
C_BRIGHTNESS_INC: '☀↑'
LA(LEFT):
LA(RIGHT):
LG(LEFT):
LG(RIGHT):
'LS(LC(LG(LALT)))': 'HYPER'
'RS(RC(RG(RALT)))': 'HYPER'
'LC(LG(LALT))': 'MEH'
'RC(RG(RALT))': 'MEH'
'LG(Q)': '⌘Q'
'LG(W)': '⌘W'
'LG(GRAVE)': '⌘`'
'LG(Z)': '⌘Z'
'LG(X)': '⌘X'
'LG(C)': '⌘C'
'LG(V)': '⌘V'
'LC(TAB)': '⌃↹'
'LS(LC(TAB))': '⌃⇧↹'
zmk_combos:
combo_tog_nav_word: {'a': 'bottom', 'o': +0.05}
combo_tog_num_word: {'a': 'bottom', 'o': +0.25}
combo_return: {'a': 'bottom', 'o': 0.3}
combo_capsword: {'k': "Caps\nWord"}
combo_tog_mouse_keys_l: {'a': 'bottom', 'o': +2}
combo_tog_mouse_keys_r: {'a': 'bottom', 'o': +2}
4 changes: 4 additions & 0 deletions keymap-drawer/gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

keymap -c config_keymap-drawer.yaml parse -c 12 -z ../config/caldera.keymap > keymap.yaml
keymap -c config_keymap-drawer.yaml draw keymap.yaml --ortho-layout '{split: true, rows: 5, columns: 6}' > out.svg
Loading

0 comments on commit 4019205

Please sign in to comment.