diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8ab0171..6ad2492 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,16 @@ -name: Build ZMK firmware -on: - workflow_dispatch: - pull_request: - push: - paths: - - "config/*.conf" - - "config/*.dtsi" - - "config/*.h" - - "config/*.keymap" - - "config/boards/**" - - "build.yaml" - -jobs: - build: - uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main +name: Build ZMK firmware +on: + workflow_dispatch: + pull_request: + push: + paths: + - "config/*.conf" + - "config/*.dtsi" + - "config/*.h" + - "config/*.keymap" + - "config/boards/**" + - "build.yaml" + +jobs: + build: + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main diff --git a/.github/workflows/draw-keymaps.yml b/.github/workflows/draw-keymaps.yml index bf8c8bc..0c6b8dd 100644 --- a/.github/workflows/draw-keymaps.yml +++ b/.github/workflows/draw-keymaps.yml @@ -1,25 +1,25 @@ -name: Draw ZMK keymaps -on: - workflow_dispatch: - push: - paths: - - ".github/workflows/draw-keymaps.yml" - - "config/*.dtsi" - - "config/*.keymap" - - "config/boards/*/*/*.keymap" - - "keymap-drawer/config.yaml" - -jobs: - draw: - uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main - permissions: - contents: write - with: - # commit_message: "[Draw] ${{ github.event.head_commit.message }}" - # amend_commit: true - install_branch: "main" - keymap_patterns: "config/*.keymap" - config_path: "keymap-drawer/config.yaml" - output_folder: "keymap-drawer" - 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'" +name: Draw ZMK keymaps +on: + workflow_dispatch: + push: + paths: + - ".github/workflows/draw-keymaps.yml" + - "config/*.dtsi" + - "config/*.keymap" + - "config/boards/*/*/*.keymap" + - "keymap-drawer/config.yaml" + +jobs: + draw: + uses: caksoylar/keymap-drawer/.github/workflows/draw-zmk.yml@main + permissions: + contents: write + with: + # commit_message: "[Draw] ${{ github.event.head_commit.message }}" + # amend_commit: true + install_branch: "main" + keymap_patterns: "config/*.keymap" + config_path: "keymap-drawer/config.yaml" + output_folder: "keymap-drawer" + 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'" diff --git a/README.md b/README.md index 3d4b605..f041ae8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# zmk-config -![SVG file of the keymap](keymap-drawer/cradio.svg) +# zmk-config +![SVG file of the keymap](keymap-drawer/cradio.svg) diff --git a/build.yaml b/build.yaml index bc2f24d..2c7af54 100644 --- a/build.yaml +++ b/build.yaml @@ -1,9 +1,9 @@ -# This file generates the GitHub Actions matrix ---- -include: - - board: nice_nano_v2 - shield: cradio_left - - board: nice_nano_v2 - shield: cradio_right - - board: nice_nano_v2 - shield: settings_reset +# This file generates the GitHub Actions matrix +--- +include: + - board: nice_nano_v2 + shield: cradio_left + - board: nice_nano_v2 + shield: cradio_right + - board: nice_nano_v2 + shield: settings_reset diff --git a/config/combos.dtsi b/config/combos.dtsi index dc54755..3f6f944 100644 --- a/config/combos.dtsi +++ b/config/combos.dtsi @@ -1,76 +1,76 @@ -/* KEY POSITIONS -34 keys: - - ╭────────────────────╮ ╭────────────────────╮ - │ 0 1 2 3 4 │ │ 5 6 7 8 9 │ - │ 10 11 12 13 14 │ │ 15 16 17 18 19 │ - │ 20 21 22 23 24 │ │ 25 26 27 28 29 │ - ╰───────────╮ 30 31 │ │ 32 33 ╭───────────╯ - ╰────────╯ ╰────────╯ -*/ - -#define COMBO(NAME, BINDINGS, KEYPOS, LAYERS, TIMEOUT, ...) \ - combo_##NAME { \ - timeout-ms = ; \ - bindings = ; \ - key-positions = ; \ - layers = ; \ - require-prior-idle-ms = <150>; \ - __VA_ARGS__ \ - }; - -#define COMBO_TERM_FAST 30 -#define COMBO_TERM_SLOW 40 - -#define HRC_TAB &hml LA(LCTRL) TAB -#define HRC_REPEAT &hml_repeat LS(LCTRL) 0 -#define HRC_LPAR &hmr_lpar_lt LS(LCTRL) 0 -#define HRC_RPAR &hmr_rpar_gt LA(LCTRL) 0 -#define HRC_PAR &hmr_par_lgt LS(LALT) 0 - -/ { - combos { - compatible = "zmk,combos"; - - COMBO(esc, &kp ESC, 1 2, DEF, COMBO_TERM_SLOW) - COMBO(enter, &kp RET, 2 3, DEF, COMBO_TERM_SLOW) - COMBO(ger, &sl GER, 1 3, DEF, COMBO_TERM_SLOW) - - COMBO(tab, HRC_TAB, 11 12, DEF, COMBO_TERM_SLOW) - COMBO(repeat, HRC_REPEAT, 12 13, DEF, COMBO_TERM_SLOW) - - COMBO(lbkt, &lbkt_lbrc, 6 7, DEF, COMBO_TERM_SLOW) - COMBO(rbkt, &rbkt_rbrc, 7 8, DEF, COMBO_TERM_SLOW) - COMBO(bkt, &bkt_brc, 6 8, DEF, COMBO_TERM_SLOW) - - COMBO(lpar, HRC_LPAR, 16 17, DEF, COMBO_TERM_SLOW) - COMBO(rpar, HRC_RPAR, 17 18, DEF, COMBO_TERM_SLOW) - COMBO(par, HRC_PAR, 16 18, DEF, COMBO_TERM_SLOW) - - COMBO(bspc, &kp BSPC, 26 27, DEF NUM, COMBO_TERM_SLOW) - COMBO(del, &kp DEL, 27 28, DEF NUM, COMBO_TERM_SLOW) - - COMBO(prcnt, &kp DE_PRCNT, 4 14, DEF, COMBO_TERM_FAST) - COMBO(dllr, &kp DE_DLLR, 3 13, DEF, COMBO_TERM_FAST) - COMBO(hash, &kp DE_HASH, 2 12, DEF, COMBO_TERM_FAST) - COMBO(at, &kp DE_AT, 1 11, DEF, COMBO_TERM_FAST) - - COMBO(tilde, &kp DE_TILDE, 14 24, DEF, COMBO_TERM_FAST) - COMBO(equal, &kp DE_EQUAL, 13 23, DEF, COMBO_TERM_FAST) - COMBO(bslh, &kp DE_BSLH, 12 22, DEF, COMBO_TERM_FAST) - COMBO(euro, &kp DE_EURO, 11 21, DEF, COMBO_TERM_FAST) - - COMBO(caret, &kp DE_CARET, 5 15, DEF, COMBO_TERM_FAST) - COMBO(plus, &kp DE_PLUS, 6 16, DEF, COMBO_TERM_FAST) - COMBO(star, &kp DE_STAR, 7 17, DEF, COMBO_TERM_FAST) - COMBO(amps, &kp DE_AMPS, 8 18, DEF, COMBO_TERM_FAST) - COMBO(sect, &kp DE_SECT, 9 19, DEF, COMBO_TERM_FAST) - - COMBO(under, &kp DE_UNDER, 15 25, DEF, COMBO_TERM_FAST) - COMBO(minus, &kp DE_MINUS, 16 26, DEF, COMBO_TERM_FAST) - COMBO(fslh, &kp DE_FSLH, 17 27, DEF, COMBO_TERM_FAST) - COMBO(pipe, &kp DE_PIPE, 18 28, DEF, COMBO_TERM_FAST) - COMBO(deg, &kp DE_DEG, 19 29, DEF, COMBO_TERM_FAST) - - }; +/* KEY POSITIONS +34 keys: + + ╭────────────────────╮ ╭────────────────────╮ + │ 0 1 2 3 4 │ │ 5 6 7 8 9 │ + │ 10 11 12 13 14 │ │ 15 16 17 18 19 │ + │ 20 21 22 23 24 │ │ 25 26 27 28 29 │ + ╰───────────╮ 30 31 │ │ 32 33 ╭───────────╯ + ╰────────╯ ╰────────╯ +*/ + +#define COMBO(NAME, BINDINGS, KEYPOS, LAYERS, TIMEOUT, ...) \ + combo_##NAME { \ + timeout-ms = ; \ + bindings = ; \ + key-positions = ; \ + layers = ; \ + require-prior-idle-ms = <150>; \ + __VA_ARGS__ \ + }; + +#define COMBO_TERM_FAST 30 +#define COMBO_TERM_SLOW 40 + +#define HRC_TAB &hml LA(LCTRL) TAB +#define HRC_REPEAT &hml_repeat LS(LCTRL) 0 +#define HRC_LPAR &hmr_lpar_lt LS(LCTRL) 0 +#define HRC_RPAR &hmr_rpar_gt LA(LCTRL) 0 +#define HRC_PAR &hmr_par_lgt LS(LALT) 0 + +/ { + combos { + compatible = "zmk,combos"; + + COMBO(esc, &kp ESC, 1 2, DEF, COMBO_TERM_SLOW) + COMBO(enter, &kp RET, 2 3, DEF, COMBO_TERM_SLOW) + COMBO(ger, &sl GER, 1 3, DEF, COMBO_TERM_SLOW) + + COMBO(tab, HRC_TAB, 11 12, DEF, COMBO_TERM_SLOW) + COMBO(repeat, HRC_REPEAT, 12 13, DEF, COMBO_TERM_SLOW) + + COMBO(lbkt, &lbkt_lbrc, 6 7, DEF, COMBO_TERM_SLOW) + COMBO(rbkt, &rbkt_rbrc, 7 8, DEF, COMBO_TERM_SLOW) + COMBO(bkt, &bkt_brc, 6 8, DEF, COMBO_TERM_SLOW) + + COMBO(lpar, HRC_LPAR, 16 17, DEF, COMBO_TERM_SLOW) + COMBO(rpar, HRC_RPAR, 17 18, DEF, COMBO_TERM_SLOW) + COMBO(par, HRC_PAR, 16 18, DEF, COMBO_TERM_SLOW) + + COMBO(bspc, &kp BSPC, 26 27, DEF NUM, COMBO_TERM_SLOW) + COMBO(del, &kp DEL, 27 28, DEF NUM, COMBO_TERM_SLOW) + + COMBO(prcnt, &kp DE_PRCNT, 4 14, DEF, COMBO_TERM_FAST) + COMBO(dllr, &kp DE_DLLR, 3 13, DEF, COMBO_TERM_FAST) + COMBO(hash, &kp DE_HASH, 2 12, DEF, COMBO_TERM_FAST) + COMBO(at, &kp DE_AT, 1 11, DEF, COMBO_TERM_FAST) + + COMBO(tilde, &kp DE_TILDE, 14 24, DEF, COMBO_TERM_FAST) + COMBO(equal, &kp DE_EQUAL, 13 23, DEF, COMBO_TERM_FAST) + COMBO(bslh, &kp DE_BSLH, 12 22, DEF, COMBO_TERM_FAST) + COMBO(euro, &kp DE_EURO, 11 21, DEF, COMBO_TERM_FAST) + + COMBO(caret, &kp DE_CARET, 5 15, DEF, COMBO_TERM_FAST) + COMBO(plus, &kp DE_PLUS, 6 16, DEF, COMBO_TERM_FAST) + COMBO(star, &kp DE_STAR, 7 17, DEF, COMBO_TERM_FAST) + COMBO(amps, &kp DE_AMPS, 8 18, DEF, COMBO_TERM_FAST) + COMBO(sect, &kp DE_SECT, 9 19, DEF, COMBO_TERM_FAST) + + COMBO(under, &kp DE_UNDER, 15 25, DEF, COMBO_TERM_FAST) + COMBO(minus, &kp DE_MINUS, 16 26, DEF, COMBO_TERM_FAST) + COMBO(fslh, &kp DE_FSLH, 17 27, DEF, COMBO_TERM_FAST) + COMBO(pipe, &kp DE_PIPE, 18 28, DEF, COMBO_TERM_FAST) + COMBO(deg, &kp DE_DEG, 19 29, DEF, COMBO_TERM_FAST) + + }; }; \ No newline at end of file diff --git a/config/cradio.json b/config/cradio.json index 83e3604..7e8d6fc 100644 --- a/config/cradio.json +++ b/config/cradio.json @@ -1,50 +1,50 @@ -{ - "id": "sweep", - "name": "ferris sweep", - "layouts": { - "LAYOUT": { - "autoGenerated": "false", - "description": "The layout for the ferris sweep.", - "layout": [ - { "row": 0, "col": 0, "x": 0, "y": 1.1 }, - { "row": 0, "col": 1, "x": 1, "y": 0.4 }, - { "row": 0, "col": 2, "x": 2, "y": 0 }, - { "row": 0, "col": 3, "x": 3, "y": 0.3 }, - { "row": 0, "col": 4, "x": 4, "y": 0.5 }, - { "row": 0, "col": 5, "x": 7, "y": 0.5 }, - { "row": 0, "col": 6, "x": 8, "y": 0.3 }, - { "row": 0, "col": 7, "x": 9, "y": 0 }, - { "row": 0, "col": 8, "x": 10, "y": 0.4 }, - { "row": 0, "col": 9, "x": 11, "y": 1.1 }, - - { "row": 1, "col": 0, "x": 0, "y": 2.1 }, - { "row": 1, "col": 1, "x": 1, "y": 1.4 }, - { "row": 1, "col": 2, "x": 2, "y": 1 }, - { "row": 1, "col": 3, "x": 3, "y": 1.3 }, - { "row": 1, "col": 4, "x": 4, "y": 1.5 }, - { "row": 1, "col": 5, "x": 7, "y": 1.5 }, - { "row": 1, "col": 6, "x": 8, "y": 1.3 }, - { "row": 1, "col": 7, "x": 9, "y": 1 }, - { "row": 1, "col": 8, "x": 10, "y": 1.4 }, - { "row": 1, "col": 9, "x": 11, "y": 2.1 }, - - { "row": 2, "col": 0, "x": 0, "y": 3.1 }, - { "row": 2, "col": 1, "x": 1, "y": 2.4 }, - { "row": 2, "col": 2, "x": 2, "y": 2 }, - { "row": 2, "col": 3, "x": 3, "y": 2.3 }, - { "row": 2, "col": 4, "x": 4, "y": 2.5 }, - { "row": 2, "col": 5, "x": 7, "y": 2.5 }, - { "row": 2, "col": 6, "x": 8, "y": 2.3 }, - { "row": 2, "col": 7, "x": 9, "y": 2 }, - { "row": 2, "col": 8, "x": 10, "y": 2.4 }, - { "row": 2, "col": 9, "x": 11, "y": 3.1 }, - - { "row": 3, "col": 3, "x": 2.5, "y": 3.3, "r": 15, "rx": 2.8, "ry": 7.9 }, - { "row": 3, "col": 4, "x": 2.5, "y": 3.3, "r": 30, "rx": 2.9, "ry": 7.9 }, - { "row": 3, "col": 5, "x": 8.5, "y": 3.3, "r": -30, "rx": 9.1, "ry": 7.9 }, - { "row": 3, "col": 6, "x": 8.5, "y": 3.3, "r": -15, "rx": 9.2, "ry": 7.9 } - ] - } - }, - "sensors": [] -} +{ + "id": "sweep", + "name": "ferris sweep", + "layouts": { + "LAYOUT": { + "autoGenerated": "false", + "description": "The layout for the ferris sweep.", + "layout": [ + { "row": 0, "col": 0, "x": 0, "y": 1.1 }, + { "row": 0, "col": 1, "x": 1, "y": 0.4 }, + { "row": 0, "col": 2, "x": 2, "y": 0 }, + { "row": 0, "col": 3, "x": 3, "y": 0.3 }, + { "row": 0, "col": 4, "x": 4, "y": 0.5 }, + { "row": 0, "col": 5, "x": 7, "y": 0.5 }, + { "row": 0, "col": 6, "x": 8, "y": 0.3 }, + { "row": 0, "col": 7, "x": 9, "y": 0 }, + { "row": 0, "col": 8, "x": 10, "y": 0.4 }, + { "row": 0, "col": 9, "x": 11, "y": 1.1 }, + + { "row": 1, "col": 0, "x": 0, "y": 2.1 }, + { "row": 1, "col": 1, "x": 1, "y": 1.4 }, + { "row": 1, "col": 2, "x": 2, "y": 1 }, + { "row": 1, "col": 3, "x": 3, "y": 1.3 }, + { "row": 1, "col": 4, "x": 4, "y": 1.5 }, + { "row": 1, "col": 5, "x": 7, "y": 1.5 }, + { "row": 1, "col": 6, "x": 8, "y": 1.3 }, + { "row": 1, "col": 7, "x": 9, "y": 1 }, + { "row": 1, "col": 8, "x": 10, "y": 1.4 }, + { "row": 1, "col": 9, "x": 11, "y": 2.1 }, + + { "row": 2, "col": 0, "x": 0, "y": 3.1 }, + { "row": 2, "col": 1, "x": 1, "y": 2.4 }, + { "row": 2, "col": 2, "x": 2, "y": 2 }, + { "row": 2, "col": 3, "x": 3, "y": 2.3 }, + { "row": 2, "col": 4, "x": 4, "y": 2.5 }, + { "row": 2, "col": 5, "x": 7, "y": 2.5 }, + { "row": 2, "col": 6, "x": 8, "y": 2.3 }, + { "row": 2, "col": 7, "x": 9, "y": 2 }, + { "row": 2, "col": 8, "x": 10, "y": 2.4 }, + { "row": 2, "col": 9, "x": 11, "y": 3.1 }, + + { "row": 3, "col": 3, "x": 2.5, "y": 3.3, "r": 15, "rx": 2.8, "ry": 7.9 }, + { "row": 3, "col": 4, "x": 2.5, "y": 3.3, "r": 30, "rx": 2.9, "ry": 7.9 }, + { "row": 3, "col": 5, "x": 8.5, "y": 3.3, "r": -30, "rx": 9.1, "ry": 7.9 }, + { "row": 3, "col": 6, "x": 8.5, "y": 3.3, "r": -15, "rx": 9.2, "ry": 7.9 } + ] + } + }, + "sensors": [] +} diff --git a/config/cradio.keymap b/config/cradio.keymap index 1e7b478..adb9652 100644 --- a/config/cradio.keymap +++ b/config/cradio.keymap @@ -1,297 +1,302 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - -#define TO_STRING(x) #x - -#ifndef KEYMAP_DRAWER -#include "keys_de.h" -#endif - -#include -#include -#include -#include -#include - -#define DEF 0 -#define NAV 1 -#define NUM 2 -#define FUN 3 -#define HW 4 -#define GER 5 -#define MSE 6 - -#define KEYS_L 0 1 2 3 4 10 11 12 13 14 20 21 22 23 24 // left hand -#define KEYS_R 5 6 7 8 9 15 16 17 18 19 25 26 27 28 29 // right hand -#define THUMBS 30 31 32 33 // thumbs - -#include "combos.dtsi" - -&caps_word { - continue-list = ; -}; - -&sk { - quick-release; - release-after-ms = <900>; -}; - -&mt { - quick-tap-ms = <220>; - tapping-term-ms = <220>; -}; - -#define HM(NAME, TAP, HT_KEYPOS) \ - NAME: NAME { \ - compatible = "zmk,behavior-hold-tap"; \ - label = TO_STRING(HM_ ## NAME); \ - #binding-cells = <2>; \ - tapping-term-ms = <280>; \ - quick-tap-ms = <175>; \ - require-prior-idle-ms = <175>; \ - flavor = "balanced"; \ - bindings = <&kp>, ; \ - hold-trigger-key-positions = ; \ - hold-trigger-on-release; \ - }; - -#define SM(NAME, TAP, SHIFTED) \ - NAME: NAME { \ - compatible = "zmk,behavior-mod-morph"; \ - label = TO_STRING(SM_ ## NAME); \ - bindings = , ; \ - #binding-cells = <0>; \ - mods = <(MOD_RSFT|MOD_LSFT)>; \ - }; - -#define TD(NAME, T_TERM, TAP1, TAP2, ...) \ - NAME: NAME { \ - compatible = "zmk,behavior-tap-dance"; \ - label = TO_STRING(TD_ ## NAME); \ - #binding-cells = <0>; \ - tapping-term-ms = <270>; \ - bindings = , __VA_OPT__(, <)__VA_ARGS__ __VA_OPT__(>); \ - }; - -#define CT(KEY) &mt LC(KEY) KEY - -/ { - behaviors { - // home row mods - HM(hml, &kp, KEYS_R) - HM(hml_repeat, &key_repeat, KEYS_R) - - HM(hmr, &kp, KEYS_L) - HM(hmr_lpar_lt, &lpar_lt, KEYS_L) - HM(hmr_rpar_gt, &rpar_gt, KEYS_L) - HM(hmr_par_lgt, &par_lgt, KEYS_L) - - // shift morphs - SM(qexcl, &kp DE_QMARK, &kp DE_EXCL) - - SM(sqt_dqt, &kp DE_SQT, &kp DE_DQT) - SM(sqt_dqt_macro, &sqt_macro, &dqt_macro) - - SM(lpar_lt, &kp DE_LPAR, &kp DE_LT) - SM(rpar_gt, &kp DE_RPAR, &kp DE_GT) - SM(par_lgt, &par_macro, &lgt_macro) - - SM(lbkt_lbrc, &kp DE_LBKT, &kp DE_LBRC) - SM(rbkt_rbrc, &kp DE_RBKT, &kp DE_RBRC) - SM(bkt_brc, &bkt_macro, &brc_macro) - - // tap-dance - TD(td_scw, 400, &kp LSHIFT, &caps_word, &kp CLCK) - TD(td_sqt_dqt, 270, &sqt_dqt, &sqt_dqt_macro) - - scw: scw { // wrapper for tap-dance, workaround for #1691 - compatible = "zmk,behavior-hold-tap"; - label = "shift-caps-word"; - bindings = <&td_scw>, <&kp>; - - #binding-cells = <2>; - tapping-term-ms = <200>; - }; - }; - - macros { - // ( ) <- - ZMK_MACRO(par_macro, - bindings = <&kp DE_LPAR &kp DE_RPAR &kp LEFT>; - ) - - // [ ] <- - ZMK_MACRO(bkt_macro, - bindings = <&kp DE_LBKT &kp DE_RBKT &kp LEFT>; - ) - - // { } <- - ZMK_MACRO(brc_macro, - bindings = <&kp DE_LBRC &kp DE_RBRC &kp LEFT>; - ) - - // ' ' <- - ZMK_MACRO(sqt_macro, - bindings = <&kp DE_SQT &kp DE_SQT &kp LEFT>; - ) - - // " " <- - ZMK_MACRO(dqt_macro, - bindings = - <&kp DE_DQT &kp DE_DQT>, - <¯o_release>, - <&kp LSHFT>, - <¯o_tap>, - <&kp LEFT>; - ) - - // < > <- - ZMK_MACRO(lgt_macro, - bindings = - <&kp DE_LT &kp DE_GT>, - <¯o_release>, - <&kp LSHFT>, - <¯o_tap>, - <&kp LEFT>; - ) - - ZMK_MACRO(bt_0, - bindings = - <&out OUT_BLE>, - <&bt BT_SEL 0>; - ) - - ZMK_MACRO(bt_1, - bindings = - <&out OUT_BLE>, - <&bt BT_SEL 1>; - ) - - ZMK_MACRO(bt_2, - bindings = - <&out OUT_BLE>, - <&bt BT_SEL 2>; - ) - }; - - conditional_layers { - compatible = "zmk,conditional-layers"; - - tri_layer { - if-layers =