From 888497dcf14b6f41842a9c012914a5555d9e1a58 Mon Sep 17 00:00:00 2001 From: Eric Neiman Date: Mon, 29 Apr 2024 18:19:21 -0400 Subject: [PATCH] sofle --- build.yaml | 4 +- config/lily58.keymap | 2 +- config/sofle.conf | 17 +++++ config/sofle.keymap | 143 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 config/sofle.conf create mode 100644 config/sofle.keymap diff --git a/build.yaml b/build.yaml index 2e9a0b8..b940431 100644 --- a/build.yaml +++ b/build.yaml @@ -19,8 +19,8 @@ --- include: - board: nice_nano_v2 - shield: lily58_left + shield: sofle_left - board: nice_nano_v2 - shield: lily58_right + shield: sofle_right - board: nice_nano_v2 shield: settings_reset diff --git a/config/lily58.keymap b/config/lily58.keymap index e3a7370..f2fef07 100644 --- a/config/lily58.keymap +++ b/config/lily58.keymap @@ -111,7 +111,7 @@ pairing_layer { bindings = < &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &trans &trans &trans &trans &trans &ext_power EP_ON -&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &ext_power EP_OFF +&trans &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &trans &trans &trans &trans &trans &ext_power EP_OFF &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &ext_power EP_TOG &trans &trans &trans &trans &trans &trans &bootloader &bootloader &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans diff --git a/config/sofle.conf b/config/sofle.conf new file mode 100644 index 0000000..0c70c02 --- /dev/null +++ b/config/sofle.conf @@ -0,0 +1,17 @@ +# Copyright (c) 2020 Ryan Cross +# SPDX-License-Identifier: MIT + +# Uncomment the following line to enable the Sofle OLED Display +CONFIG_ZMK_DISPLAY=y + +# Uncomment these two lines to add support for encoders +CONFIG_EC11=y +CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y + +# Uncomment this line below to add rgb underglow / backlight support +# CONFIG_ZMK_RGB_UNDERGLOW=y + +# Uncomment the line below to disable external power toggling by the underglow. +# By default toggling the underglow on and off also toggles external power +# on and off. This also causes the display to turn off. +# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n diff --git a/config/sofle.keymap b/config/sofle.keymap new file mode 100644 index 0000000..3cc0e32 --- /dev/null +++ b/config/sofle.keymap @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2020 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include +#include + +#define BASE 0 +#define LOWER 1 +#define RAISE 2 +#define ADJUST 3 + +/ { + macros { + ctrl_alt_home: ctrl_alt_home { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LCTRL &kp LALT>, + <¯o_tap &kp HOME>, + <¯o_release &kp LCTRL &kp LALT>; + }; + ctrl_win_left: ctrl_win_left { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LCTRL &kp LGUI>, + <¯o_tap &kp LEFT>, + <¯o_release &kp LCTRL &kp LGUI>; + }; + ctrl_win_right: ctrl_win_right { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LCTRL &kp LGUI>, + <¯o_tap &kp RIGHT>, + <¯o_release &kp LCTRL &kp LGUI>; + }; + ctrl_shift_esc: ctrl_shift_esc { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LCTRL &kp LSHIFT>, + <¯o_tap &kp ESC>, + <¯o_release &kp LCTRL &kp LSHIFT>; + }; + alt_f4: alt_f4 { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LALT>, + <¯o_tap &kp F4>, + <¯o_release &kp LALT>; + }; + ctrl_shift_r: ctrl_shift_r { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LCTRL &kp LSHIFT>, + <¯o_tap &kp R>, + <¯o_release &kp LCTRL &kp LSHIFT>; + }; + win_l: win_l { + compatible = "zmk,behavior-macro"; + #binding-cells = <0>; + bindings = <¯o_press &kp LGUI>, + <¯o_tap &kp L>, + <¯o_release &kp LGUI>; + }; + }; +}; + +/ { + + // Activate ADJUST layer by pressing raise and lower + conditional_layers { + compatible = "zmk,conditional-layers"; + adjust_layer { + if-layers = ; + then-layer = ; + }; + }; + + keymap { + compatible = "zmk,keymap"; + + default_layer { + display-name = "default"; +// ------------------------------------------------------------------------------------------------------------ +// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | +// | ESC | Q | W | E | R | T | | Y | U | I | O | P | BKSPC | +// | TAB | A | S | D | F | G | | H | J | K | L | ; | ' | +// | SHIFT | Z | X | C | V | B | MUTE | | | N | M | , | . | / | SHIFT | +// | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI | + bindings = < +&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp BSPC +&kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp BSLH +&kp LCTRL &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT +&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &kp F5 &kp C_PP &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT + &kp LGUI &kp LALT &kp ESC &mo 1 &kp SPACE &kp RET &mo 2 &kp F5 &kp LBKT &kp RBKT + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + lower_layer { + display-name = "lower"; + bindings = < +&kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 +&trans &trans &kp UP &trans &trans &trans &trans &trans &trans &trans &trans &trans +&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &trans &trans +&kp CAPS &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans + &trans &trans &ctrl_shift_esc &trans &trans &trans &trans &ctrl_shift_r &kp MINUS &kp EQUAL + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + raise_layer { + display-name = "raise"; + bindings = < +&trans &kp N7 &kp N8 &kp N9 &trans &trans &trans &trans &trans &trans &trans &kp DEL +&trans &kp N4 &kp N5 &kp N6 &trans &trans &trans &trans &trans &trans &trans &kp INS +&trans &kp N1 &kp N2 &kp N3 &trans &trans &trans &trans &trans &win_l &kp UP &trans +&trans &kp N0 &trans &kp RET &trans &trans &trans &trans &ctrl_alt_home &ctrl_win_left &ctrl_win_right &kp LEFT &kp DOWN &kp RIGHT + &trans &trans &trans &trans &trans &trans &trans &ctrl_shift_r &kp MINUS &kp EQUAL + >; + + sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN &inc_dec_kp PG_UP PG_DN>; + }; + + adjust_layer { + display-name = "adjust"; + bindings = < +&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &bt BT_CLR &none &none &none &none &none &ext_power EP_ON +&none &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &none &none &none &none &none &ext_power EP_OFF +&none &none &none &none &none &none &none &none &none &none &none &ext_power EP_TOG +&none &none &none &none &none &none &none &none &none &none &none &none &none &none + &none &none &none &bootloader &bootloader &none &none &none + >; + }; + + }; +};