Skip to content

Commit bdb7786

Browse files
thrlygithub-actions[bot]
authored andcommitted
Add keymap_drawer and configs
1 parent ce7d889 commit bdb7786

5 files changed

Lines changed: 2143 additions & 0 deletions

File tree

.github/workflows/draw-keymap.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Use the keymap-drawer ZMK user config workflow
2+
# https://github.com/caksoylar/keymap-drawer#setting-up-an-automated-drawing-workflow
3+
name: Draw ZMK keymaps
4+
on:
5+
workflow_dispatch: # can be triggered manually
6+
push: # automatically run on changes to following paths
7+
paths:
8+
- "config/*.keymap"
9+
- "config/*.dtsi"
10+
- "keymap_drawer.config.yaml"
11+
- ".github/workflows/draw-keymaps.yml"
12+
- "img/keymap-img/keymap_drawer.config.yaml"
13+
# - 'boards/*/*/*.keymap'
14+
15+
jobs:
16+
draw:
17+
uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main
18+
permissions:
19+
contents: write # allow workflow to commit to the repo
20+
with:
21+
keymap_patterns: "config/*.keymap" # path to the keymaps to parse
22+
config_path: "img/keymap-img/keymap_drawer.config.yaml" # config file, ignored if not exists
23+
output_folder: "img/keymap-img" # path to save produced SVG and keymap YAML files
24+
json_path: "config"
25+
# extra_keymap_yaml: "${keyboard}: 'images/keymap-img/combos.yaml'"
26+
parse_args: "" # map of extra args to pass to `keymap parse`, e.g. "corne:'-l Def Lwr Rse' cradio:''"
27+
draw_args: "" # map of extra args to pass to `keymap draw`, e.g. "corne:'-k corne_rotated' cradio:'-k paroxysm'"
28+
amend_commit: true # amend generated files to commit that produces them
29+
fail_on_error: true
30+
debug_mode: false

config/corne.dtsi

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
/*
2+
* Copyright (c) 2020 Pete Johanson
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
#include <dt-bindings/zmk/matrix_transform.h>
8+
9+
#include <layouts/foostan/corne/5column.dtsi>
10+
#include <layouts/foostan/corne/6column.dtsi>
11+
12+
&foostan_corne_6col_layout {
13+
transform = <&default_transform>;
14+
};
15+
16+
&foostan_corne_5col_layout {
17+
transform = <&five_column_transform>;
18+
};
19+
20+
/ {
21+
chosen {
22+
zephyr,display = &oled;
23+
zmk,kscan = &kscan0;
24+
zmk,physical-layout = &foostan_corne_6col_layout;
25+
};
26+
27+
default_transform: keymap_transform_0 {
28+
compatible = "zmk,matrix-transform";
29+
columns = <12>;
30+
rows = <4>;
31+
// | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 |
32+
// | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 |
33+
// | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 |
34+
// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 |
35+
map = <
36+
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11)
37+
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11)
38+
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
39+
RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8)
40+
>;
41+
};
42+
43+
five_column_transform: keymap_transform_1 {
44+
compatible = "zmk,matrix-transform";
45+
columns = <10>;
46+
rows = <4>;
47+
// | SW2 | SW3 | SW4 | SW5 | SW6 | | SW6 | SW5 | SW4 | SW3 | SW2 |
48+
// | SW8 | SW9 | SW10 | SW11 | SW12 | | SW12 | SW11 | SW10 | SW9 | SW8 |
49+
// | SW14 | SW15 | SW16 | SW17 | SW18 | | SW18 | SW17 | SW16 | SW15 | SW14 |
50+
// | SW19 | SW20 | SW21 | | SW21 | SW20 | SW19 |
51+
map = <
52+
RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10)
53+
RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10)
54+
RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10)
55+
RC(3,3) RC(3,4) RC(3,5) RC(3,6) RC(3,7) RC(3,8)
56+
>;
57+
};
58+
59+
kscan0: kscan {
60+
compatible = "zmk,kscan-gpio-matrix";
61+
wakeup-source;
62+
63+
diode-direction = "col2row";
64+
row-gpios
65+
= <&pro_micro 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
66+
, <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
67+
, <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
68+
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
69+
;
70+
71+
};
72+
73+
// TODO: per-key RGB node(s)?
74+
};
75+
76+
&pro_micro_i2c {
77+
status = "okay";
78+
79+
oled: ssd1306@3c {
80+
compatible = "solomon,ssd1306fb";
81+
reg = <0x3c>;
82+
width = <128>;
83+
height = <32>;
84+
segment-offset = <0>;
85+
page-offset = <0>;
86+
display-offset = <0>;
87+
multiplex-ratio = <31>;
88+
segment-remap;
89+
com-invdir;
90+
com-sequential;
91+
inversion-on;
92+
prechargep = <0x22>;
93+
};
94+
};

0 commit comments

Comments
 (0)