From 0a28b9ff6e336a43f7007a1cecb6ed7b5c28502d Mon Sep 17 00:00:00 2001 From: Seth Milliken Date: Sun, 10 Dec 2023 03:00:33 -0800 Subject: [PATCH] add coconut planck --- .github/workflows/build-planck.yml | 15 +++ config/planck_rev6.conf | 25 +++++ config/planck_rev6.json | 61 ++++++++++++ config/planck_rev6.keymap | 146 +++++++++++++++++++++++++++++ planck_rev6.yaml | 2 + 5 files changed, 249 insertions(+) create mode 100644 .github/workflows/build-planck.yml create mode 100644 config/planck_rev6.conf create mode 100644 config/planck_rev6.json create mode 100644 config/planck_rev6.keymap create mode 100644 planck_rev6.yaml diff --git a/.github/workflows/build-planck.yml b/.github/workflows/build-planck.yml new file mode 100644 index 00000000..0c20b638 --- /dev/null +++ b/.github/workflows/build-planck.yml @@ -0,0 +1,15 @@ +name: 'Build Coconut Planck Firmware' +on: + workflow_dispatch: # can be triggered manually + push: # automatically run on changes to following paths + paths: + - 'planck_rev6.yaml' + - 'config/planck_rev6.*' + - 'config/shared.dtsi' + +jobs: + build: + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main + with: + build_matrix_path: planck_rev6.yaml + archive_name: coconut_planck diff --git a/config/planck_rev6.conf b/config/planck_rev6.conf new file mode 100644 index 00000000..fe55e6d3 --- /dev/null +++ b/config/planck_rev6.conf @@ -0,0 +1,25 @@ +# Name as advertised in Bluetooth +CONFIG_ZMK_KEYBOARD_NAME="Coconut Planck" + +# Allow control (with behaviors) of power to peripherals (e.g. display, lighting) +CONFIG_ZMK_EXT_POWER=y + +# Low-power deep sleep mode +CONFIG_ZMK_SLEEP=y +# deep sleep timeout, 15 minutes +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=900000 + +# Turn on logging, and set ZMK logging to debug output +# Monitor with e.g. `sudo tio /dev/tty.usbmodem14401` +#CONFIG_ZMK_USB_LOGGING=y + +#CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=1 +#CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=1 + +# Uncomment the following lines to enable the RGB Underglow +CONFIG_ZMK_RGB_UNDERGLOW=y +CONFIG_WS2812_STRIP=y + +CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP=5 +CONFIG_ZMK_RGB_UNDERGLOW_SAT_STEP=5 +CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP=5 diff --git a/config/planck_rev6.json b/config/planck_rev6.json new file mode 100644 index 00000000..6c85b4b6 --- /dev/null +++ b/config/planck_rev6.json @@ -0,0 +1,61 @@ +{ + "layouts": { + "default": { + "layout": [ + + { "row": 0, "col": 0, "x": 0, "y": 0.36 }, + { "row": 0, "col": 1, "x": 1, "y": 0.36 }, + { "row": 0, "col": 2, "x": 2, "y": 0.36 }, + { "row": 0, "col": 3, "x": 3, "y": 0.36 }, + { "row": 0, "col": 4, "x": 4, "y": 0.36 }, + { "row": 0, "col": 5, "x": 5, "y": 0.36 }, + { "row": 0, "col": 7, "x": 6, "y": 0.36 }, + { "row": 0, "col": 8, "x": 7, "y": 0.36 }, + { "row": 0, "col": 9, "x": 8, "y": 0.36 }, + { "row": 0, "col": 10, "x": 9, "y": 0.36 }, + { "row": 0, "col": 11, "x": 10, "y": 0.36 }, + { "row": 0, "col": 12, "x": 11, "y": 0.36 }, + + { "row": 1, "col": 0, "x": 0, "y": 0.36 }, + { "row": 1, "col": 1, "x": 1, "y": 0.36 }, + { "row": 1, "col": 2, "x": 2, "y": 0.36 }, + { "row": 1, "col": 3, "x": 3, "y": 0.36 }, + { "row": 1, "col": 4, "x": 4, "y": 0.36 }, + { "row": 1, "col": 5, "x": 5, "y": 0.36 }, + { "row": 1, "col": 7, "x": 6, "y": 0.36 }, + { "row": 1, "col": 8, "x": 7, "y": 0.36 }, + { "row": 1, "col": 9, "x": 8, "y": 0.36 }, + { "row": 1, "col": 10, "x": 9, "y": 0.36 }, + { "row": 1, "col": 11, "x": 10, "y": 0.36 }, + { "row": 1, "col": 12, "x": 11, "y": 0.36 }, + + { "row": 2, "col": 0, "x": 0, "y": 0.36 }, + { "row": 2, "col": 1, "x": 1, "y": 0.36 }, + { "row": 2, "col": 2, "x": 2, "y": 0.36 }, + { "row": 2, "col": 3, "x": 3, "y": 0.36 }, + { "row": 2, "col": 4, "x": 4, "y": 0.36 }, + { "row": 2, "col": 5, "x": 5, "y": 0.36 }, + { "row": 2, "col": 7, "x": 6, "y": 0.36 }, + { "row": 2, "col": 8, "x": 7, "y": 0.36 }, + { "row": 2, "col": 9, "x": 8, "y": 0.36 }, + { "row": 2, "col": 10, "x": 9, "y": 0.36 }, + { "row": 2, "col": 11, "x": 10, "y": 0.36 }, + { "row": 2, "col": 12, "x": 11, "y": 0.36 }, + + { "row": 3, "col": 0, "x": 0, "y": 0.36 }, + { "row": 3, "col": 1, "x": 1, "y": 0.36 }, + { "row": 3, "col": 2, "x": 2, "y": 0.36 }, + { "row": 3, "col": 3, "x": 3, "y": 0.36 }, + { "row": 3, "col": 4, "x": 4, "y": 0.36 }, + { "row": 3, "col": 5, "x": 5, "y": 0.36 }, + { "row": 3, "col": 7, "x": 6, "y": 0.36 }, + { "row": 3, "col": 8, "x": 7, "y": 0.36 }, + { "row": 3, "col": 9, "x": 8, "y": 0.36 }, + { "row": 3, "col": 10, "x": 9, "y": 0.36 }, + { "row": 3, "col": 11, "x": 10, "y": 0.36 }, + { "row": 3, "col": 12, "x": 11, "y": 0.36 } + + ] + } + } +} diff --git a/config/planck_rev6.keymap b/config/planck_rev6.keymap new file mode 100644 index 00000000..2a3ad1e2 --- /dev/null +++ b/config/planck_rev6.keymap @@ -0,0 +1,146 @@ +// HEADERS {{{ +#include +#include +#include +#include +#include +#include +#include + +#include "shared.dtsi" + +// }}} +/ { +// KEYMAP {{{ +// n.b. display-name strings are truncated after 8 characters + keymap { + compatible = "zmk,keymap"; + + /* 0 Layer */ + default { + display-name = "araxia"; + bindings = < +&kp Q &kp W &kp E &kp R &kp T &kp F1 &kp F2 &kp Y &kp U &kp I &kp O &kp P +&hrml LCTRL A &hrml LGUI S &hrml LALT D &hrml LSHIFT F &hrml GLOBE G &kp F3 &kp F4 &h_bs &hrmr RSHIFT J &hrmr RALT K &hrmr RGUI L &hrmr RCTRL SEMICOLON +&kp Z &kp X &kp C &kp V &kp B &kp F5 &kp F6 &kp N &m_cr &kp COMMA &kp DOT &kp FSLH +&kp F7 &kp F8 &mthp LGUI RETURN <hp 2 LC(W) <hp 1 ESC &kp F9 &kp F10 <hp 4 ESC <tp 3 SPACE &mttp RGUI COLON &kp F11 &kp F12 + >; + }; + + /* 1 Layer */ + symbols { + display-name = "symbols"; + bindings = < +&kp COMMA &kp AMPERSAND &kp ASTERISK &kp TILDE &kp BACKSLASH &trans &trans &kp LESS_THAN &kp GREATER_THAN &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp DOUBLE_QUOTES +&kp DOT &kp DOLLAR &kp PERCENT &kp CARET &kp TAB &trans &trans &kp MINUS &kp EQUAL &kp LEFT_BRACE &kp RIGHT_BRACE &kp SINGLE_QUOTE +&kp EQUAL &kp EXCLAMATION &kp AT &kp POUND &kp PIPE &trans &trans &kp UNDERSCORE &kp PLUS &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp GRAVE +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 2 Layer */ + lnum { + display-name = "lnum"; + bindings = < +&kp COMMA &kp N7 &kp N8 &kp N9 &kp N0 &trans &trans &none &none &none &none &none +&kp DOT &kp N4 &kp N5 &kp N6 &kp COLON &trans &trans &none &none &none &none &kp GRAVE +&kp EQUAL &kp N1 &kp N2 &kp N3 &kp MINUS &trans &trans &none &none &none &none &trigrave +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 3 Layer */ + numpad { + display-name = "numpad"; + bindings = < +&kp COMMA &kp N7 &kp N8 &kp N9 &kp N0 &trans &trans &f2_menu &f2_dock &f2_status &help_menu &kp TAB +&kp DOT &kp N4 &kp N5 &kp N6 &kp COLON &trans &trans &kp LEFT &kp DOWN &kp UP &kp RIGHT &kp RETURN +&kp EQUAL &kp N1 &kp N2 &kp N3 &kp MINUS &trans &trans &kp PAGE_UP &kp PAGE_DOWN &kp HOME &kp END &kp KP_NUMLOCK +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 4 Layer */ + media { + display-name = "media"; + bindings = < +&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &trans &trans &kp C_MUTE &kp C_PREV &kp C_PP &kp C_NEXT &kp C_BRI_UP +&kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &trans &trans &kp C_VOL_DN &kp C_VOL_UP &out OUT_TOG &bt BT_CLR &kp C_BRI_DN +&kp F11 &kp F12 &kp F13 &kp F14 &kp F15 &trans &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 5 Layer */ + window_left { + display-name = "move [L]"; + bindings = < +&win_next &forward &backward &tab_next &tab_prev &trans &trans &act Y &act U &act I &act O &act P +&swap &win_quad &win_third &win_half &win_full &trans &trans &act H &act J &act K &act L &act COLON +&winswap &win_vquad &win_vthird &win_vhalf &win_screen &trans &trans &act N &act M &act LESS_THAN &act GREATER_THAN &act QUESTION +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 6 Layer */ + window_right { + display-name = "move [R]"; + bindings = < +&act Q &act W &act E &act R &act T &trans &trans &tab_prev &tab_next &backward &forward &win_next +&act A &act S &act D &act F &act G &trans &trans &win_full &win_half &win_third &win_quad &swap +&act Z &act X &act C &act V &act B &trans &trans &win_screen &win_vhalf &win_vthird &win_vquad &winswap +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 7 Layer */ + /* Do not use this then-layer for regular layer switching */ + adjust { + display-name = "adjust"; + bindings = < +&zoom_tog &vim_exit_all &none &ss_win &to 0 &trans &trans &ext_power EP_TOG &none &none &none &none +&zoom_in &vim_save &ss2c &ss &warpd_l &trans &trans &warpd_r &warpd_j &warpd_k &tmux_pw &tmux_ps +&zoom_out &vim_exit &sss2c &sss &out OUT_USB &trans &trans &out OUT_BLE &none &none &tmux_nw &tmux_ns +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 8 Layer */ + /* Do not use this then-layer for regular layer switching */ + lighting { + display-name = "lighting"; + bindings = < +&none &none &rgb_ug RGB_BRI &rgb_ug RGB_BRD &rgb_ug RGB_COLOR_HSB(25,100,0) &trans &trans &glo C &glo N &kp F18 &kp F17 &kp F16 +&none &none &rgb_ug RGB_SAI &rgb_ug RGB_SAD &rgb_ug RGB_COLOR_HSB(25,100,80) &trans &trans &glo H &glo Q &kp F21 &kp F20 &kp F19 +&none &none &rgb_ug RGB_HUI &rgb_ug RGB_HUD &rgb_ug RGB_COLOR_HSB(25,0,100) &trans &trans &glo N &none &kp F24 &kp F23 &kp F22 +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 9 Layer */ + discord { + display-name = "discord"; + bindings = < +&none &none &none &none &none &trans &trans &act N &none &none &none &none +&none &none &none &none &none &trans &trans &kp PAGE_DOWN &dis_down &dis_up &kp PAGE_UP &act N +&none &none &none &none &none &trans &trans &kp PAGE_UP &kp PAGE_DOWN &kp HOME &kp END &none +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + /* 10 Layer */ + pointer { + display-name = "pointer"; + bindings = < +&warpd_t &warpd_l &fmmv MOVE_UP &warpd_r &none &trans &trans &none &none &none &none &none +&none &fmmv MOVE_LEFT &mkp LCLK &fmmv MOVE_RIGHT &msc SCRL_UP &trans &trans &mmv MOVE_LEFT &mmv MOVE_DOWN &mmv MOVE_UP &mmv MOVE_RIGHT &none +&none &none &fmmv MOVE_DOWN &mkp RCLK &msc SCRL_DOWN &trans &trans &mkp LCLK &mkp RCLK &none &none &none +&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + >; + }; + + }; + +}; +// }}} +/* vim: set ft=dts: */ diff --git a/planck_rev6.yaml b/planck_rev6.yaml new file mode 100644 index 00000000..0f2ca01c --- /dev/null +++ b/planck_rev6.yaml @@ -0,0 +1,2 @@ +include: + - board: planck_rev6