diff --git a/.github/workflows/build-zmk-config.yml b/.github/workflows/build-zmk-config.yml new file mode 100644 index 00000000..a6ea3c65 --- /dev/null +++ b/.github/workflows/build-zmk-config.yml @@ -0,0 +1,12 @@ +name: Build ZMK Config + +on: [push, pull_request, workflow_dispatch] + +permissions: + contents: read + +jobs: + build: + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@v0.3.0 + with: + config_path: "zmk-config" diff --git a/build.yaml b/build.yaml new file mode 100644 index 00000000..7515ab2a --- /dev/null +++ b/build.yaml @@ -0,0 +1,23 @@ +# This file generates the GitHub Actions matrix +# For simple board + shield combinations, add them +# to the top level board and shield arrays, for more +# control, add individual board + shield combinations to +# the `include` property, e.g: +# +# board: [ "nice_nano_v2" ] +# shield: [ "corne_left", "corne_right" ] +# include: +# - board: bdn9_rev2 +# - board: nice_nano_v2 +# shield: reviung41 +# +--- +include: + - board: nice_nano_v2 + shield: urchin_left nice_view_adapter nice_view_gem + snippet: studio-rpc-usb-uart + cmake-args: -DCONFIG_ZMK_STUDIO=y + - board: nice_nano_v2 + shield: urchin_right nice_view_adapter nice_view_gem + - board: nice_nano_v2 + shield: settings_reset diff --git a/zmk-config/keymap_italian.h b/zmk-config/keymap_italian.h new file mode 100644 index 00000000..1587d84f --- /dev/null +++ b/zmk-config/keymap_italian.h @@ -0,0 +1,122 @@ +/** + * This file includes custom keycodes for the italian input language setting. + * If you only type in english, you can delete this file and it's import. + * If you wish to replace this file with your preferred language, use + * the qmk version as reference: + * https://github.com/qmk/qmk_firmware/tree/master/quantum/keymap_extras +*/ + + +/* + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ \ │ │ │ │ │ │ │ │ │ │ │ ' │ ì │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ è │ + │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ò │ à │ ù │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ < │ │ │ │ │ │ │ │ , │ . │ - │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define IT_BSLH GRAVE // backslash +#define IT_SQUOT MINUS // ' +#define IT_IGRV EQUAL // ì +// Row 2 +#define IT_EGRV LBKT // è +#define IT_PLUS SLASH // + +// Row 3 +#define IT_OGRV SEMI // ò +#define IT_AGRV APOS // à +#define IT_UGRV NON_US_HASH // ù +// Row 4 +#define IT_LESS NON_US_BSLH // < +#define IT_MINUS RBKT // - + +/* Shifted symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ | │ ! │ " │ £ │ $ │ % │ & │ / │ ( │ ) │ = │ ? │ ^ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ é │ * │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ ç │ ° │ § │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ > │ │ │ │ │ │ │ │ ; │ : │ _ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 1 +#define IT_PIPE LS(GRAVE) // | +#define IT_EXCL LS(N1) // ! +#define IT_DQUOT LS(N2) // " +#define IT_PND LS(N3) // £ +#define IT_USD LS(N4) // $ +#define IT_PERC LS(N5) // % +#define IT_AND LS(N6) // & +#define IT_FSLH LS(N7) // / +#define IT_LPAR LS(N8) // ( +#define IT_RPAR LS(N9) // ) +#define IT_EQL LS(N0) // = +#define IT_QUES LS(MINUS) // ? +#define IT_CARET LS(EQUAL) // ^ +// Row 2 +#define IT_EACU LS(LBKT) // é +#define IT_AST LS(RBKT) // * +// Row 3 +#define IT_CCED LS(SEMI) // ç +#define IT_DEG LS(APOS) // ° +#define IT_SECT LS(NON_US_HASH) // § +// Row 4 +#define IT_GREAT LS(NON_US_BSLH) // > +#define IT_UNDER LS(SLASH) // _ + +/* AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ € │ │ │ │ │ │ │ │ [ │ ] │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ @ │ # │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 2 +#define IT_EUR RA(E) // € +#define IT_LBKT RA(LBKT) // [ +#define IT_RBKT RA(RBKT) // ] +// Row 3 +#define IT_AT RA(SEMI) // @ +#define IT_HASH RA(APOS) // # + +/* Shift+AltGr symbols + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ { │ } │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ + */ +// Row 2 +#define IT_LBRC LS(RA(LBKT)) // { +#define IT_RBRC LS(RA(RBKT)) // } + +/** + * Personalized symbols. + * + * These symbols are not part of the default italian input. + * I use a custom windows keymap to input them. +*/ +#define IT_BKTK RA(MINUS) // ` +#define IT_TILDE RA(EQUAL) // ~ +#define IT_CEGR RA(LS(E)) // È diff --git a/zmk-config/urchin.conf b/zmk-config/urchin.conf new file mode 100644 index 00000000..55f5c11b --- /dev/null +++ b/zmk-config/urchin.conf @@ -0,0 +1,30 @@ +# enable bluetooth +CONFIG_BT=y + +# increase bluetooth signal power +CONFIG_BT_CTLR_TX_PWR_PLUS_8=y + +# enable deep sleep support +CONFIG_ZMK_SLEEP=y + +# the keyboard disconnects from bluetooth. +# uses very little power, but it may take +# a few seconds to reconnect after waking. +# 1.800.000 ms = 30 minutes +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000 + +# "Eager Debouncing" +# Trying to lower the input lag. +# CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1 +# CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=5 + +# --- DISPLAY SETTINGS --- + +# enable display +CONFIG_ZMK_DISPLAY=y +# custom status screen (nice-view-gem) +CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM=y +# turn off gem animation to save battery +CONFIG_NICE_VIEW_GEM_ANIMATION=n + +# source: https://github.com/M165437/nice-view-gem/blob/main/README.md diff --git a/zmk-config/urchin.json b/zmk-config/urchin.json new file mode 100644 index 00000000..15798f7f --- /dev/null +++ b/zmk-config/urchin.json @@ -0,0 +1,46 @@ +{ + "layouts": { + "default_transform": { + "layout": [ + { "row": 0, "col": 0, "x": -2, "y": 0.75 }, + { "row": 0, "col": 1, "x": -1, "y": 0 }, + { "row": 0, "col": 2, "x": 0, "y": -0.25 }, + { "row": 0, "col": 3, "x": 1, "y": 0 }, + { "row": 0, "col": 4, "x": 2, "y": 0.25 }, + { "row": 0, "col": 5, "x": 6, "y": 0.25 }, + { "row": 0, "col": 6, "x": 7, "y": 0 }, + { "row": 0, "col": 7, "x": 8, "y": -0.25 }, + { "row": 0, "col": 8, "x": 9, "y": 0 }, + { "row": 0, "col": 9, "x": 10, "y": 0.5 }, + + { "row": 1, "col": 0, "x": -2, "y": 1.75 }, + { "row": 1, "col": 1, "x": -1, "y": 1 }, + { "row": 1, "col": 2, "x": 0, "y": 0.75 }, + { "row": 1, "col": 3, "x": 1, "y": 1 }, + { "row": 1, "col": 4, "x": 2, "y": 1.25 }, + { "row": 1, "col": 5, "x": 6, "y": 1.25 }, + { "row": 1, "col": 6, "x": 7, "y": 1 }, + { "row": 1, "col": 7, "x": 8, "y": 0.75 }, + { "row": 1, "col": 8, "x": 9, "y": 1 }, + { "row": 1, "col": 9, "x": 10, "y": 1.5 }, + + { "row": 2, "col": 0, "x": -2, "y": 2.75 }, + { "row": 2, "col": 1, "x": -1, "y": 2 }, + { "row": 2, "col": 2, "x": 0, "y": 1.75 }, + { "row": 2, "col": 3, "x": 1, "y": 2 }, + { "row": 2, "col": 4, "x": 2, "y": 2.25 }, + { "row": 2, "col": 5, "x": 6, "y": 2.25 }, + { "row": 2, "col": 6, "x": 7, "y": 2 }, + { "row": 2, "col": 7, "x": 8, "y": 1.75 }, + { "row": 2, "col": 8, "x": 9, "y": 2 }, + { "row": 2, "col": 9, "x": 10, "y": 2.5 }, + + { "row": 3, "col": 3, "x": 0.5, "y": 3.75, "r": 15, "rx": 2.98, "ry": 8.395 }, + { "row": 3, "col": 4, "x": 0.75, "y": 3.5, "r": 30, "rx": 1.73, "ry": 7.895 }, + { "row": 3, "col": 5, "x": 7.75, "y": 4, "r": -30, "rx": 6.48, "ry": 9.145 }, + { "row": 3, "col": 6, "x": 7.5, "y": 3.57, "r": -15, "rx": 6.73, "ry": 8.395 } + ] + } + }, + "sensors": [] +} diff --git a/zmk-config/urchin.keymap b/zmk-config/urchin.keymap new file mode 100644 index 00000000..44e05658 --- /dev/null +++ b/zmk-config/urchin.keymap @@ -0,0 +1,70 @@ +#include +#include +#include +#include + +/ { + behaviors { + hrm: behavior_home_row_mod { + compatible = "zmk,behavior-hold-tap"; + #binding-cells = <2>; + bindings = <&kp &kp>; + flavor = "tap-preferred"; + tapping-term-ms = <200>; + quick-tap-ms = <150>; + }; + }; + combos { + compatible = "zmk,combos"; + escape_left { + timeout-ms = <50>; + key-positions = <10 11 12 13>; + bindings = <&kp ESC>; + }; + escape_right { + timeout-ms = <50>; + key-positions = <16 17 18 19>; + bindings = <&kp ESC>; + }; + enter_left { + timeout-ms = <50>; + key-positions = <11 12>; + bindings = <&kp ENTER>; + }; + enter_right { + timeout-ms = <50>; + key-positions = <17 18>; + bindings = <&kp ENTER>; + }; + }; + keymap { + compatible = "zmk,keymap"; + default_layer { + label = "alphabet"; + bindings = < + &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P + &hrm LCTRL A &hrm LGUI S &hrm LALT D &hrm LSHIFT F &kp G &kp H &hrm RSHIFT J &hrm RALT K &hrm RGUI L &hrm RCTRL SEMI + &kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp SLASH + &bootloader < 2 SPACE < 1 BSPC &bootloader + >; + }; + num_layer { + label = "numbers/symbols"; + bindings = < + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 + &hrm LCTRL A &hrm LGUI S &hrm LALT LBKT &hrm LSHIFT RBKT &kp CAPSLOCK &kp BSLH &hrm RSHIFT J &hrm RALT K &hrm RGUI L &hrm RCTRL SEMI + &kp LPAR &kp RPAR &kp EQUAL &kp PLUS &kp MINUS &kp PIPE &kp SQT &kp DQT &kp TILDE &kp GRAVE + &none &kp TAB &none &none + >; + }; + nav_layer { + label = "navigation"; + bindings = < + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp HOME &kp PG_DN &kp PG_UP &kp END &kp DEL + &hrm LCTRL A &hrm LGUI S &hrm LALT D &hrm LSHIFT F &kp G &kp LEFT &hrm RSHIFT DOWN &hrm RALT UP &hrm RGUI RIGHT &hrm RCTRL SEMI + &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 + &none &none &none &none + >; + }; + }; +}; diff --git a/zmk-config/west.yml b/zmk-config/west.yml new file mode 100644 index 00000000..b55dacd9 --- /dev/null +++ b/zmk-config/west.yml @@ -0,0 +1,27 @@ +manifest: + remotes: + # zmk official + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + # bravekarma + - name: caksoylar + url-base: https://github.com/caksoylar + # kyek / duckyb + - name: duckyb + url-base: https://github.com/duckyb + # nice-view-gem + - name: m165437 + url-base: https://github.com/M165437 + projects: + - name: zmk + remote: zmkfirmware + revision: v0.3.0 + import: app/west.yml + - name: urchin-zmk-module + remote: duckyb + revision: main + - name: nice-view-gem + remote: m165437 + revision: main + self: + path: config