Skip to content

Commit

Permalink
Merge pull request #1 from carrefinho/studio
Browse files Browse the repository at this point in the history
Add ZMK Studio support and clean up
  • Loading branch information
carrefinho authored Nov 17, 2024
2 parents d5d3973 + 57adc1b commit 3cafe6b
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 41 deletions.
52 changes: 49 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Forager ZMK Config
# Forager ZMK Module

This is the sample ZMK config module for [the Forager keyboard](https://github.com/carrefinho/forager).
This is the ZMK module for [the Forager keyboard](https://github.com/carrefinho/forager).

It uses the awesome [zmk-rgbled-widget from caksoylar](https://github.com/caksoylar/zmk-rgbled-widget).
[ZMK Studio](https://zmk.dev/docs/features/studio) is supported and enabled by default.

Featuring the awesome [zmk-rgbled-widget by caksoylar](https://github.com/caksoylar/zmk-rgbled-widget).

# Usage

Add these lines to `config/west.yml` in your `zmk-config` repository:

```yaml
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
- name: carrefinho # <---
url-base: https://github.com/carrefinho # <---
- name: caksoylar # <---
url-base: https://github.com/caksoylar # <---
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
- name: forager-zmk-module # <---
remote: carrefinho # <---
revision: main # <---
- name: zmk-rgbled-widget # <---
remote: caksoylar # <---
revision: main # <---
self:
path: config
```
Then add `forager_left` and `forager_right` shields to your `build.yaml`:

```yaml
---
include:
- board: seeeduino_xiao_ble
shield: forager_left rgbled_adapter
snippet: studio-rpc-usb-uart
- board: seeeduino_xiao_ble
shield: forager_right rgbled_adapter
```

For more information on ZMK Modules and building locally, see [the ZMK docs page on modules.](https://zmk.dev/docs/features/modules)

To customize behavior of the RGB LED, see [rgbled-widget documentation.](https://github.com/caksoylar/zmk-rgbled-widget)
7 changes: 5 additions & 2 deletions boards/shields/forager/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
if FORAGER_LEFT
if SHIELD_FORAGER_LEFT

config ZMK_KEYBOARD_NAME
default "Forager"

config ZMK_SPLIT_ROLE_CENTRAL
default y

config ZMK_STUDIO
default y

endif

if FORAGER_LEFT || FORAGER_RIGHT
if SHIELD_FORAGER_LEFT || SHIELD_FORAGER_RIGHT

config ZMK_SPLIT
default y
Expand Down
4 changes: 2 additions & 2 deletions boards/shields/forager/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
config FORAGER_LEFT
config SHIELD_FORAGER_LEFT
def_bool $(shields_list_contains,forager_left)

config FORAGER_RIGHT
config SHIELD_FORAGER_RIGHT
def_bool $(shields_list_contains,forager_right)
51 changes: 49 additions & 2 deletions boards/shields/forager/forager.dtsi
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include <physical_layouts.dtsi>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
zmk,physical-layout = &default_layout;
};

kscan0: kscan_0 {
Expand All @@ -12,9 +13,52 @@
wakeup-source;
};

default_layout: default_layout {
compatible = "zmk,physical-layout";
display-name = "Default Layout";
transform = <&default_transform>;

keys // w h x y rot rx ry
= <&key_physical_attrs 100 100 0 61 0 0 0>
, <&key_physical_attrs 100 100 100 28 0 0 0>
, <&key_physical_attrs 100 100 200 0 0 0 0>
, <&key_physical_attrs 100 100 300 17 0 0 0>
, <&key_physical_attrs 100 100 400 28 0 0 0>
, <&key_physical_attrs 100 100 750 28 0 0 0>
, <&key_physical_attrs 100 100 850 17 0 0 0>
, <&key_physical_attrs 100 100 950 0 0 0 0>
, <&key_physical_attrs 100 100 1050 28 0 0 0>
, <&key_physical_attrs 100 100 1150 61 0 0 0>
, <&key_physical_attrs 100 100 0 161 0 0 0>
, <&key_physical_attrs 100 100 100 128 0 0 0>
, <&key_physical_attrs 100 100 200 100 0 0 0>
, <&key_physical_attrs 100 100 300 117 0 0 0>
, <&key_physical_attrs 100 100 400 128 0 0 0>
, <&key_physical_attrs 100 100 750 128 0 0 0>
, <&key_physical_attrs 100 100 850 117 0 0 0>
, <&key_physical_attrs 100 100 950 100 0 0 0>
, <&key_physical_attrs 100 100 1050 128 0 0 0>
, <&key_physical_attrs 100 100 1150 161 0 0 0>
, <&key_physical_attrs 100 100 0 261 0 0 0>
, <&key_physical_attrs 100 100 100 228 0 0 0>
, <&key_physical_attrs 100 100 200 200 0 0 0>
, <&key_physical_attrs 100 100 300 217 0 0 0>
, <&key_physical_attrs 100 100 400 228 0 0 0>
, <&key_physical_attrs 100 100 750 228 0 0 0>
, <&key_physical_attrs 100 100 850 217 0 0 0>
, <&key_physical_attrs 100 100 950 200 0 0 0>
, <&key_physical_attrs 100 100 1050 228 0 0 0>
, <&key_physical_attrs 100 100 1150 261 0 0 0>
, <&key_physical_attrs 100 100 400 350 2500 450 400>
, <&key_physical_attrs 100 100 500 370 2500 450 400>
, <&key_physical_attrs 100 100 650 370 (-2500) 800 400>
, <&key_physical_attrs 100 100 750 350 (-2500) 800 400>
;
};

default_transform: keymap_transform_0 {
compatible = "zmk,matrix-transform";
columns = <12>;
columns = <10>;
rows = <4>;

map = <
Expand All @@ -24,5 +68,8 @@
RC(3,3) RC(3,4) RC(3,5) RC(3,6)
>;
};
};

&xiao_serial {
status = "disabled";
};
7 changes: 3 additions & 4 deletions boards/shields/forager/forager.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
as: auto_shift {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
tapping_term_ms = <250>;
// quick_tap_ms = <0>;
tapping-term-ms = <250>;
require-prior-idle-ms = <100>;
flavor = "tap-preferred";
bindings = <&kp>, <&kp>;
};
ht: hold_tap {
compatible = "zmk,behavior-hold-tap";
#binding-cells = <2>;
tapping_term_ms = <200>;
tapping-term-ms = <200>;
flavor = "balanced";
bindings = <&kp>, <&kp>;
};
Expand Down Expand Up @@ -112,7 +111,7 @@
adj {
bindings = <
&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_CLR_ALL &kp C_SLEEP &trans &trans &kp C_BRI_DN &kp C_BRI_UP
&trans &trans &trans &trans &trans &trans &trans &trans &kp C_VOL_DN &kp C_VOL_UP
&studio_unlock &trans &trans &trans &trans &trans &trans &trans &kp C_VOL_DN &kp C_VOL_UP
&bootloader &trans &trans &trans &trans &trans &trans &trans &trans &bootloader
&trans &trans &trans &trans
>;
Expand Down
3 changes: 2 additions & 1 deletion boards/shields/forager/forager.zmk.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
file_format: "1"
id: forager
name: forager
name: Forager
type: shield
requires: [seeeduino_xiao_ble]
features:
- keys
- studio
siblings:
- forager_left
- forager_right
15 changes: 0 additions & 15 deletions boards/shields/forager/forager_left.conf

This file was deleted.

12 changes: 0 additions & 12 deletions boards/shields/forager/forager_right.conf

This file was deleted.

1 change: 1 addition & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
include:
- board: seeeduino_xiao_ble
shield: forager_left rgbled_adapter
snippet: studio-rpc-usb-uart
- board: seeeduino_xiao_ble
shield: forager_right rgbled_adapter
- board: seeeduino_xiao_ble
Expand Down

0 comments on commit 3cafe6b

Please sign in to comment.