Skip to content

Commit

Permalink
sofle
Browse files Browse the repository at this point in the history
  • Loading branch information
EricNeiman committed Apr 29, 2024
1 parent 355f850 commit 888497d
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 3 deletions.
4 changes: 2 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion config/lily58.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions config/sofle.conf
Original file line number Diff line number Diff line change
@@ -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
143 changes: 143 additions & 0 deletions config/sofle.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/rgb.h>
#include <dt-bindings/zmk/ext_power.h>

#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 = <&macro_press &kp LCTRL &kp LALT>,
<&macro_tap &kp HOME>,
<&macro_release &kp LCTRL &kp LALT>;
};
ctrl_win_left: ctrl_win_left {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LCTRL &kp LGUI>,
<&macro_tap &kp LEFT>,
<&macro_release &kp LCTRL &kp LGUI>;
};
ctrl_win_right: ctrl_win_right {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LCTRL &kp LGUI>,
<&macro_tap &kp RIGHT>,
<&macro_release &kp LCTRL &kp LGUI>;
};
ctrl_shift_esc: ctrl_shift_esc {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LCTRL &kp LSHIFT>,
<&macro_tap &kp ESC>,
<&macro_release &kp LCTRL &kp LSHIFT>;
};
alt_f4: alt_f4 {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LALT>,
<&macro_tap &kp F4>,
<&macro_release &kp LALT>;
};
ctrl_shift_r: ctrl_shift_r {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LCTRL &kp LSHIFT>,
<&macro_tap &kp R>,
<&macro_release &kp LCTRL &kp LSHIFT>;
};
win_l: win_l {
compatible = "zmk,behavior-macro";
#binding-cells = <0>;
bindings = <&macro_press &kp LGUI>,
<&macro_tap &kp L>,
<&macro_release &kp LGUI>;
};
};
};

/ {

// Activate ADJUST layer by pressing raise and lower
conditional_layers {
compatible = "zmk,conditional-layers";
adjust_layer {
if-layers = <LOWER RAISE>;
then-layer = <ADJUST>;
};
};

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
>;
};

};
};

0 comments on commit 888497d

Please sign in to comment.