From b44eab60f98e373111f25b8088b512c6329f9948 Mon Sep 17 00:00:00 2001 From: Zeljko Bekcic Date: Sun, 13 Oct 2024 16:29:44 +0200 Subject: [PATCH] make config better --- build.sh | 9 +- .../shields/temper-dongle/temper_dongle.conf | 1 + .../temper-dongle/temper_dongle.keymap | 211 ++++++++---------- 3 files changed, 94 insertions(+), 127 deletions(-) diff --git a/build.sh b/build.sh index 120032ec..ccc76078 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,5 @@ -ZMK_APP_PATH="$HOME/Projects/Private/zmk/app" -ZMK_CONFIG_ROOT_PATH="$HOME/Projects/Private/temper-zmk-config" +ZMK_APP_PATH="$HOME/Projects/private/zmk/app" +ZMK_CONFIG_ROOT_PATH="$HOME/Projects/private/temper-zmk-config" OUTPUT_DIRECTORY="$ZMK_CONFIG_ROOT_PATH/outputs/" rm -rf "$OUTPUT_DIRECTORY" @@ -7,6 +7,7 @@ mkdir -p "$OUTPUT_DIRECTORY" ( cd "$ZMK_APP_PATH" + echo ">>> $ZMK_APP_PATH" source ../.venv/bin/activate # format to json lines then read ech json object per loop iterationn @@ -14,8 +15,10 @@ mkdir -p "$OUTPUT_DIRECTORY" board=$(echo "$line" | yq -p=json '.board') shield=$(echo "$line" | yq -p=json '.shield') - west build -d "build/$shield-$board" -b "$board" --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_ROOT_PATH/config" -DSHIELD="$shield" > "$OUTPUT_DIRECTORY/$shield-$board.log" + echo ">>> " west build -d "build/$shield-$board" -b "$board" --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_ROOT_PATH/config" -DSHIELD="$shield" '>' "$OUTPUT_DIRECTORY/$shield-$board.log" + west build -d "build/$shield-$board" -b "$board" --pristine -- -DZMK_CONFIG="$ZMK_CONFIG_ROOT_PATH/config" -DSHIELD="$shield" #> "$OUTPUT_DIRECTORY/$shield-$board.log" + echo ">>>" cp "build/$shield-$board/zephyr/zmk.uf2" "$OUTPUT_DIRECTORY/$shield-$board.uf2" cp "build/$shield-$board/zephyr/zmk.uf2" "$OUTPUT_DIRECTORY/$shield-$board.uf2" done diff --git a/config/boards/shields/temper-dongle/temper_dongle.conf b/config/boards/shields/temper-dongle/temper_dongle.conf index 6b4a087e..9fa7bb1f 100644 --- a/config/boards/shields/temper-dongle/temper_dongle.conf +++ b/config/boards/shields/temper-dongle/temper_dongle.conf @@ -1 +1,2 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y +CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y diff --git a/config/boards/shields/temper-dongle/temper_dongle.keymap b/config/boards/shields/temper-dongle/temper_dongle.keymap index aee0b995..d449fd11 100644 --- a/config/boards/shields/temper-dongle/temper_dongle.keymap +++ b/config/boards/shields/temper-dongle/temper_dongle.keymap @@ -9,140 +9,103 @@ #include #include -#define DEFAULT 0 -#define QWERTY 1 -#define NUM 2 -#define NAV 3 -#define FUN 4 +#define BASE 0 +#define NAV 1 +#define SYM 2 +#define NUM 3 +#define ADJ 4 + +#define HYPER &sk LG(LC(LA(LSHFT))) +#define MEH &sk LC(LA(LSHFT)) +#define TAB_LEFT &kp LG(LS(LBKT)) +#define TAB_RIGHT &kp LG(LS(RBKT)) + +#define BTClear &bt BT_CLR +#define BT0 &bt BT_SEL 0 +#define BT1 &bt BT_SEL 1 +#define BT2 &bt BT_SEL 2 +#define BT3 &bt BT_SEL 3 +#define BT4 &bt BT_SEL 4 + +#define TAPPING_TERM 150 +#define TAPPING_TERM_GUIALT 200 +#define TAPPING_TERM_PINKY 200 + + + +< { + flavor = "tap-preferred"; + tapping-term-ms = ; +}; + +&mt { + flavor = "tap-preferred"; + tapping-term-ms = ; +}; + +&sk { + quick-release; +}; / { - conditional_layers { + behaviors { + }; + + conditional_layers { compatible = "zmk,conditional-layers"; + tri_layer { - if-layers = ; - then-layer = ; + if-layers = ; + then-layer = ; }; }; - behaviors { - bspc_del: backspace_delete { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp BACKSPACE>, <&kp DELETE>; - mods = <(MOD_LSFT|MOD_RSFT)>; - keep-mods = <(MOD_RSFT)>; - }; - super_bspc: super_backspace { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp BACKSPACE>, <&kp LA(BACKSPACE)>; - mods = <(MOD_LSFT|MOD_RSFT)>; - }; - smart_shft: smart_shift { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp LSHFT>, <&caps_word>; - mods = <(MOD_LSFT)>; - }; - comma_semi: comma_semi { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp COMMA>, <&kp SEMI>; - mods = <(MOD_LSFT)>; + + keymap { + compatible = "zmk,keymap"; + base_layer { + bindings = < + &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp SQT + &kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O + &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &kp COMMA &kp DOT &kp FSLH + &kp ENTER &mo NAV &kp SPACE &kp LSHFT &mo SYM &kp LCTRL + >; }; - dot_colon: dot_colon { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp DOT>, <&kp COLON>; - mods = <(MOD_LSFT)>; + + nav_layer { + bindings = < + &kp TAB &none &none &none &none &none &kp HOME &kp END &kp BSPC &kp DEL + &sk LSHFT &sk LCTRL &sk LALT &sk LCMD MEH &none &kp LEFT &kp DOWN &kp UP &kp RIGHT + &none &none &none &none &none &none &none &kp PG_DN &kp PG_UP &none + &trans &trans &trans &trans &trans &trans + >; }; - qmrk_excl: qmrk_excl { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp QMARK>, <&kp EXCL>; - mods = <(MOD_LSFT)>; + + sym_layer { + bindings = < + &kp ESC &kp DLLR &kp PRCNT &kp LPAR &kp RPAR &kp CARET &kp TILDE &kp GRAVE &kp PIPE &kp BSLH + &kp MINUS &kp PLUS &kp EQUAL &kp LBRC &kp RBRC &kp HASH &sk RCMD &sk RALT &sk RCTRL &sk RSHFT + &kp UNDER &kp STAR &kp AT &kp LBKT &kp RBKT &none &kp AMPS &kp SEMI &kp COLON &kp EXCL + &trans &trans &mo ADJ &trans &trans &trans + >; }; - slh_morph: slh_morph { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp FSLH>, <&kp BSLH>; - mods = <(MOD_LSFT)>; + + num_layer { + bindings = < + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 + &sk LSHFT &sk LCTRL &sk LALT &sk LCMD &kp F11 &kp F12 &sk RCMD &sk RALT &sk RCTRL &sk RSHFT + &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 + &trans &trans &trans &trans &trans &trans + >; }; - amps_morph: amps_morph { - compatible = "zmk,behavior-mod-morph"; - #binding-cells = <0>; - bindings = <&kp AMPS>, <&kp PIPE>; - mods = <(MOD_LSFT)>; + + adj_layer { + bindings = < + &none &none &none &none BTClear &kp C_VOLUME_UP &kp C_NEXT &none &none &none + BT4 BT3 BT2 BT1 BT0 &kp C_VOLUME_DOWN &kp C_PREVIOUS &none &none &none + &none &none &none &bootloader &none &kp C_MUTE &kp C_PLAY_PAUSE &none &none &trans + &trans &trans &trans &trans &trans &trans + >; }; + }; - keymap { - compatible = "zmk,keymap"; - - default_layer { - bindings = < -// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ - &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Y &kp APOS -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &kp Z &kp X &kp C &kp D &kp V &kp K &kp H &comma_semi &dot_colon &qmrk_excl -// ╰─────────────┴─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┴─────────────╯ - &kp LGUI &mo NUM &smart_shft &kp SPACE &mo NAV &super_bspc -// ╰─────────────┴─────────────┴─────────────╯ ╰─────────────┴─────────────┴─────────────╯ - >; - }; - qwerty_layer { - bindings = < -// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ - &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH -// ╰─────────────┴─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┴─────────────╯ - &trans &trans &trans &trans &trans &trans -// ╰─────────────┴─────────────┴─────────────╯ ╰─────────────┴─────────────┴─────────────╯ - >; - }; - num_layer { - bindings = < -// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ - &kp TILDE &kp AT &kp LBRC &kp RBRC &kp PRCNT &kp STAR &kp N7 &kp N8 &kp N9 &kp MINUS -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &kp CARET &kp HASH &kp LPAR &kp RPAR &kp DLLR &kp UNDER &kp N4 &kp N5 &kp N6 &kp PLUS -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &s_morph &kp LT &kp LBKT &kp RBKT &kp GT &slh_morph &kp N1 &kp N2 &kp N3 &kp EQUAL -// ╰─────────────┴─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┴─────────────╯ - &trans &trans &trans &kp N0 &trans &trans -// ╰─────────────┴─────────────┴─────────────╯ ╰─────────────┴─────────────┴─────────────╯ - >; - }; - - nav_layer { - bindings = < -// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ - &trans &trans &trans &trans &trans &trans &kp HOME &kp END &kp TAB &super_bspc -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &sk LSHFT &sk LCTRL &sk LALT &sk LGUI &kp TAB &kp LEFT &kp DOWN &kp UP &kp RIGHT &gresc -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &trans &kp DEL &trans &trans &trans &trans &kp RET &trans &trans &trans -// ╰─────────────┴─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┴─────────────╯ - &trans &trans &trans &trans &trans &trans -// ╰─────────────┴─────────────┴─────────────╯ ╰─────────────┴─────────────┴─────────────╯ - >; - }; - - fun_layer { - bindings = < -// ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ - &tog QWERTY &kp K_MUTE &kp C_VOL_DN &kp C_VOL_UP &out OUT_TOG &trans &kp F7 &kp F8 &kp F9 &kp F12 -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &kp F4 &kp F5 &kp F6 &kp F11 -// ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ - &bt BT_CLR &kp C_PREV &kp C_PP &kp C_NEXT &trans &trans &kp F1 &kp F2 &kp F3 &kp F10 -// ╰─────────────┴─────────────┼─────────────┼─────────────┼─────────────┤ ├─────────────┼─────────────┼─────────────┼─────────────┴─────────────╯ - &trans &trans &trans &trans &trans &trans -// ╰─────────────┴─────────────┴─────────────╯ ╰─────────────┴─────────────┴─────────────╯ - >; - }; - }; };