diff options
author | jack <[email protected]> | 2023-01-06 14:39:20 -0700 |
---|---|---|
committer | jack <[email protected]> | 2023-01-06 14:39:20 -0700 |
commit | 736812340fbb675f582747308ae347c382ada023 (patch) | |
tree | e56b0d6f95f161a38864eca5493a2ca501065361 | |
parent | f0bef0edd90b9d1426a617a9f4d28536957f8a00 (diff) | |
download | zmk_build-736812340fbb675f582747308ae347c382ada023.tar.gz zmk_build-736812340fbb675f582747308ae347c382ada023.zip |
fixup build script & add tap dance macros
-rwxr-xr-x | build.sh | 52 | ||||
-rw-r--r-- | config/corne.keymap | 61 | ||||
-rw-r--r-- | util.h | 19 |
3 files changed, 45 insertions, 87 deletions
@@ -1,10 +1,9 @@ #!/bin/sh ZSDK_VERSION=0.13.2 -ZEN_BRANCH=Board-Corne-ish-Zen-dedicated-work-queue +WEST_CMD="west build -p -b" LINK=~/waffle_git/zmk/app/boards/shields/revxlp CONFIG_DIR=~/waffle_git/zmk-build/config ZMK_DIR=~/waffle_git/zmk -UF2=~/*.uf2 update() { (cd ${ZMK_DIR} ; git pull ; west update) @@ -14,12 +13,6 @@ update() { rm zephyr-toolchain-arm-${ZSDK_VERSION}-linux-x86_64-setup.run } -test_uf2() { - if test -f ${UF2}; then - rm ${UF2} - fi -} - read -p "update? (y/n) " -n 1 -r if [[ $REPLY =~ ^[Yy]$ ]] then @@ -28,67 +21,46 @@ fi echo -e "\n" PS3="choose keyboard to build: " -options=("corne" "corne-ish zen" "revxlp" "settings reset" "quit") +options=("corne" "revxlp" "settings reset" "quit") select opt in "${options[@]}" do case $opt in "corne") echo "building corne firmware..." - test_uf2 - (cd ${ZMK_DIR} - if [ $(git branch --show-current) == "${ZEN_BRANCH}"]; then - git checkout main - update - fi) (cd ${ZMK_DIR}/app - west build -p -b nice_nano -- -DSHIELD=corne_left -DZMK_CONFIG="${CONFIG_DIR}" + ${WEST_CMD} nice_nano -- -DSHIELD=corne_left -DZMK_CONFIG="${CONFIG_DIR}" 1> /dev/null cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/corne_left.uf2 - west build -p -b nice_nano_v2 -- -DSHIELD=corne_right -DZMK_CONFIG="${CONFIG_DIR}" + ${WEST_CMD} nice_nano_v2 -- -DSHIELD=corne_right -DZMK_CONFIG="${CONFIG_DIR}" 1> /dev/null cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/corne_right.uf2 ) - break - ;; - "corne-ish zen") - echo "building corne-ish zen firmware..." - test_uf2 - cp config/corne.keymap config/corne-ish_zen.keymap - (cd ${ZMK_DIR} - if [[ $(git branch --show-current) = "main" ]]; then - git checkout ${ZEN_BRANCH} - update - fi) - (cd ${ZMK_DIR}/app - west build -p -b corne-ish_zen_left -- -DZMK_CONFIG="${CONFIG_DIR}" - cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/corne-ish_zen_left.uf2 - west build -p -b corne-ish_zen_right -- -DZMK_CONFIG="${CONFIG_DIR}" - cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/corne-ish_zen_right.uf2 - ) - rm config/corne-ish_zen.keymap + echo "complete :^)" break ;; "revxlp") echo "building revxlp firmware..." - test_uf2 cp config/corne.keymap revxlp/revxlp.keymap if ! [ -L $LINK]; then ln -s ~/waffle_git/zmk-build/revxlp $LINK fi (cd ${ZMK_DIR}/app - west build -p -b seeeduino_xiao_ble -- -DSHIELD=revxlp + ${WEST_CMD} seeeduino_xiao_ble -- -DSHIELD=revxlp 1> /dev/null cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/revxlp.uf2 ) rm revxlp/revxlp.keymap + echo "complete :^)" break ;; "settings reset") echo "building settings reset firmware..." - test_uf2 (cd ${ZMK_DIR}/app - west build -p -b nice_nano -- -DSHIELD=settings_reset + ${WEST_CMD} nice_nano -- -DSHIELD=settings_reset &> /dev/null cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/settings_reset_v1.uf2 - west build -p -b nice_nano_v2 -- -DSHIELD=settings_reset + ${WEST_CMD} nice_nano_v2 -- -DSHIELD=settings_reset &> /dev/null cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/settings_reset_v2.uf2 + ${WEST_CMD} seeeduino_xiao_ble -- -DSHIELD=settings_reset &> /dev/null + cp ${ZMK_DIR}/app/build/zephyr/zmk.uf2 ~/settings_reset_xiao.uf2 ) + echo "complete :^)" break ;; "quit") diff --git a/config/corne.keymap b/config/corne.keymap index d101938..70f34c8 100644 --- a/config/corne.keymap +++ b/config/corne.keymap @@ -65,34 +65,11 @@ tapping-term-ms = <210>; bindings = <&kp C_PLAY>, <&kp C_NEXT>, <&kp C_PREV>; }; - bsls_pipe: backslash_pipe { - compatible = "zmk,behavior-tap-dance"; - label = "BACKSLASH_PIPE"; - #binding-cells = <0>; - tapping-term-ms = <200>; - bindings = <&kp BSLH>, <&kp PIPE>; - }; - quot_dquo: quote_dquote { - compatible = "zmk,behavior-tap-dance"; - label = "QUOTE_DQUOTE"; - #binding-cells = <0>; - tapping-term-ms = <200>; - bindings = <&kp SQT>, <&kp DQT>; - }; - cbrkt: l_r_curly_bracket { - compatible = "zmk,behavior-tap-dance"; - label = "L_R_CURLY_BRACKET"; - #binding-cells = <0>; - tapping-term-ms = <200>; - bindings = <&kp LBRC>, <&kp RBRC>; - }; - brkt: l_r_bracket { - compatible = "zmk,behavior-tap-dance"; - label = "L_R_BRACKET"; - #binding-cells = <0>; - tapping-term-ms = <200>; - bindings = <&kp LBKT>, <&kp RBKT>; - }; + + TAP_DANCE(bsls_pipe, &kp BSLH, &kp PIPE, #) + TAP_DANCE(quot_dquo, &kp SQT, &kp DQT, #) + TAP_DANCE(cbrkt, &kp LBRC, &kp RBRC, #) + TAP_DANCE(brkt, &kp LBKT, &kp RBKT, #) }; macros { @@ -107,19 +84,19 @@ combos { compatible = "zmk,combos"; // name output pos. layer - COMBO(ru_ent, &kp RET, 4 7, 0 1) - COMBO(dk_eql, &kp EQUAL, 15 20, 0 1) - COMBO(gh_quot, "_dquo, 17 18, 0 1) - COMBO(vm_ques, &kp QMARK, 28 31, 0 1) - COMBO(ty_coln, &kp COLON, 5 6, 0 1) - COMBO(bn_unds, &kp UNDER, 29 30, 0 1) - COMBO(er_cbkt, &cbrkt, 3 4, 0 1) - COMBO(ui_brkt, &brkt, 7 8, 0 1) - COMBO(sl_plus, &kp PLUS, 14 21, 0 1) - COMBO(ei_bsls, &bsls_pipe, 3 8, 0 1) - COMBO(wo_mins, &kp MINUS, 2 9, 0 1) - COMBO(fj_capw, &caps_word, 16 19, 0 1) - COMBO(qp_clmk, &tog 1, 1 10, 0) - COMBO(qp_qwrt, &tog 0, 1 10, 1) + COMBO(ru_ent, &kp RET, 4 7, 0 1) + COMBO(dk_eql, &kp EQUAL, 15 20, 0 1) + COMBO(gh_quot, &td_quot_dquo, 17 18, 0 1) + COMBO(vm_ques, &kp QMARK, 28 31, 0 1) + COMBO(ty_coln, &kp COLON, 5 6, 0 1) + COMBO(bn_unds, &kp UNDER, 29 30, 0 1) + COMBO(er_cbkt, &td_cbrkt, 3 4, 0 1) + COMBO(ui_brkt, &td_brkt, 7 8, 0 1) + COMBO(sl_plus, &kp PLUS, 14 21, 0 1) + COMBO(ei_bsls, &td_bsls_pipe, 3 8, 0 1) + COMBO(wo_mins, &kp MINUS, 2 9, 0 1) + COMBO(fj_capw, &caps_word, 16 19, 0 1) + COMBO(qp_clmk, &tog 1, 1 10, 0) + COMBO(qp_qwrt, &tog 0, 1 10, 1) }; }; @@ -2,11 +2,20 @@ // SPDX-License-Identifier: MIT #define COMBO(name, keypress, keypos, layer) \ -combo_##name { \ - layers = <layer>; \ - timeout-ms = <50>; \ - bindings = <keypress>; \ - key-positions = <keypos>; \ +combo_##name { \ + layers = <layer>; \ + timeout-ms = <50>; \ + bindings = <keypress>; \ + key-positions = <keypos>; \ +}; + +#define TAP_DANCE(name, keypress1, keypress2, hash) \ +td_##name: name { \ + compatible = "zmk,behavior-tap-dance"; \ + label = "name"; \ + hash##binding-cells = <0>; \ + tapping-term-ms = <200>; \ + bindings = <keypress1>, <keypress2>; \ }; #define HRML(k1,k2,k3,k4) &hm LALT k1 &hm LGUI k2 &hm LCTRL k3 &hm LSHFT k4 |