From 16c1dfe4a9cfb1b29123bb3ceb5310951f057b7a Mon Sep 17 00:00:00 2001 From: Leon Etienne Date: Mon, 3 Aug 2026 00:54:44 +0200 Subject: [PATCH] keymap: Colemak UML layer with arrows, BT combos, fix BLE/settings config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UML layer: arrows on T(↑) C(←) D(↓) V(→), ALT on Enter - BT profile switching via combos: CTRL+Q/W/F/P → profiles 1-4 - Explicit CONFIG_ZMK_BLE, CONFIG_FLASH, CONFIG_NVS, CONFIG_SETTINGS_NVS - Board name: seeeduino_xiao_ble → xiao_ble - Add .gitignore, AGENTS.md (build docs), BINDINGS.md (keymap ref) --- .gitignore | 18 +++++ AGENTS.md | 37 ++++++++++ BINDINGS.md | 85 +++++++++++++++++++++++ config/boards/shields/totem/totem.zmk.yml | 2 +- config/totem.conf | 17 ++++- config/totem.keymap | 40 ++++------- 6 files changed, 170 insertions(+), 29 deletions(-) create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 BINDINGS.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..53d4828 --- /dev/null +++ b/.gitignore @@ -0,0 +1,18 @@ +# Build artifacts +build/ +*.uf2 + +# West-managed submodules +modules/ +optional/ +zephyr/ +zmk/ + +# West state +.west/ + +# macOS +.DS_Store + +# Reasonix +.reasonix/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..1100323 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,37 @@ +# AGENTS.md — TOTEM ZMK Config + +## Build + +Local Docker build (no GitHub Actions needed): + +```bash +docker run --rm \ + -v $(pwd):/workspace/zmk-config \ + -w /workspace/zmk-config \ + zmkfirmware/zmk-build-arm:stable \ + bash -c " + git config --global --add safe.directory '*' + west zephyr-export + west build -s zmk/app -d build/left -b xiao_ble -- -DSHIELD=totem_left -DZMK_CONFIG=/workspace/zmk-config/config + west build -s zmk/app -d build/right -b xiao_ble -- -DSHIELD=totem_right -DZMK_CONFIG=/workspace/zmk-config/config + " + +cp build/left/zephyr/zmk.uf2 totem_left.uf2 +cp build/right/zephyr/zmk.uf2 totem_right.uf2 +``` + +- Clean build dirs between config changes: `rm -rf build/left build/right` +- The Docker image `zmkfirmware/zmk-build-arm:stable` must be pulled first (~3 GB) +- Board name is `xiao_ble` (not `seeeduino_xiao_ble` — that was the old name) +- `west update` only needed when ZMK/Zephyr deps change (pulls submodules) +- `CONFIG_ZMK_BLE=y` is explicitly set in `config/totem.conf` (board defconfig alone proved unreliable) + +## Keymap + +The active keymap is `config/totem.keymap`. It overrides the shield default at `config/boards/shields/totem/totem.keymap`. + +3 layers: `BASE` (0), `UML` (1), `BT` (2). + +## BINDINGS.md + +**After every binding change** in `config/totem.keymap`, update `BINDINGS.md` with an ASCII graphic of all three layers and the quick-reference table. The physical key labels in the ASCII art must match the BASE layer positions exactly. diff --git a/BINDINGS.md b/BINDINGS.md new file mode 100644 index 0000000..7b1b3a8 --- /dev/null +++ b/BINDINGS.md @@ -0,0 +1,85 @@ +# TOTEM Keymap Reference + +> Auto-generated from `config/totem.keymap`. **Must be updated after every binding change.** + +--- + +## Layer 0: BASE (Colemak) + +``` +┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ +│ Q │ W │ F │ P │ B │ │ J │ L │ U │ Z │ ? │ +├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ +│ A │ R │ S │ T │ G │ │ M │ N │ E │ I │ O │ +├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ +│ ⇧ │ Y │ X │ C │ D │ V │ │ K │ H │ / │ , │ . │ ⎋ │ +└─────┴─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┴─────┴─────┘ + │ ␣ │ UML │ ⏎ │ │CTRL │ SPR │ ⌫ │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ +``` + +--- + +## Layer 1: UML (hold left thumb) + +``` +┌─────┬─────┬─────┬─────┬─────┐ ┌─────┬─────┬─────┬─────┬─────┐ +│ 1 │ 2 │ 3 │ 4 │ 5 │ │ + │ @ │ Ü │ { │ ~ │ +├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ +│ Ä │ · │ ß │ ↑ │ · │ │ / │ ` │ > │ } │ Ö │ +├─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┼─────┤ +│ · │ · │ · │ ← │ ↓ │ → │ │ 6 │ 7 │ 8 │ 9 │ 0 │ * │ +└─────┴─────┼─────┼─────┼─────┼─────┤ ├─────┼─────┼─────┼─────┴─────┴─────┘ + │ ⇥ │ · │ ⌥ │ │CTRL │ ( │ ) │ + └─────┴─────┴─────┘ └─────┴─────┴─────┘ + +· = transparent (falls through to BASE) +⌥ = LALT / Option +``` + +### Arrow cluster + +``` + T → ↑ +C → ← D → ↓ V → → +``` + +| Physical key | Action | +|-------------|--------| +| T | ↑ | +| C | ← | +| D | ↓ | +| V | → | + +--- + +## Bluetooth Profile Switching + +CTRL is a normal modifier key. BT profiles are switched via **combos** (press both keys +within 50ms of each other): + +| Combo | Action | +|-------|--------| +| **CTRL + Q** | BT profile 1 | +| **CTRL + W** | BT profile 2 | +| **CTRL + F** | BT profile 3 | +| **CTRL + P** | BT profile 4 | + +CTRL works normally for all other shortcuts (CTRL+C, CTRL+V, etc. are unaffected). +On macOS these combos do not conflict with standard shortcuts (which use Cmd, not Ctrl). + +--- + +## Quick Reference + +| Shortcut | Action | +|----------|--------| +| **UML + T** | ↑ | +| **UML + C** | ← | +| **UML + D** | ↓ | +| **UML + V** | → | +| **UML + ENT** | ALT / Option | +| **CTRL + Q** | BT profile 1 | +| **CTRL + W** | BT profile 2 | +| **CTRL + F** | BT profile 3 | +| **CTRL + P** | BT profile 4 | diff --git a/config/boards/shields/totem/totem.zmk.yml b/config/boards/shields/totem/totem.zmk.yml index 537a041..b32fcf9 100644 --- a/config/boards/shields/totem/totem.zmk.yml +++ b/config/boards/shields/totem/totem.zmk.yml @@ -3,7 +3,7 @@ id: totem name: TOTEM type: shield url: https://github.com/GEIGEIGEIST/TOTEM -requires: [seeeduino_xiao_ble] +requires: [xiao_ble] features: - keys siblings: diff --git a/config/totem.conf b/config/totem.conf index 5682145..d418be2 100644 --- a/config/totem.conf +++ b/config/totem.conf @@ -1 +1,16 @@ -CONFIG_ZMK_USB_LOGGING=n \ No newline at end of file +CONFIG_ZMK_USB_LOGGING=n + +# Explicitly enable BLE (needed for xiao_ble) +CONFIG_ZMK_BLE=y + +# Settings storage (board defconfig not reliably applied) +CONFIG_FLASH=y +CONFIG_FLASH_PAGE_LAYOUT=y +CONFIG_FLASH_MAP=y +CONFIG_NVS=y +CONFIG_SETTINGS_NVS=y + +# Erst nach 10 Min Inaktivität schlafen +CONFIG_ZMK_IDLE_TIMEOUT=3600000 +CONFIG_ZMK_SLEEP=y +CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=3600000 diff --git a/config/totem.keymap b/config/totem.keymap index 629e44f..9d6fb91 100644 --- a/config/totem.keymap +++ b/config/totem.keymap @@ -10,9 +10,16 @@ #define BASE 0 #define UML 1 -#define BT 2 / { + combos { + compatible = "zmk,combos"; + combo_bt1 { timeout-ms = <50>; key-positions = <0 35>; bindings = <&bt BT_SEL 0>; }; + combo_bt2 { timeout-ms = <50>; key-positions = <1 35>; bindings = <&bt BT_SEL 1>; }; + combo_bt3 { timeout-ms = <50>; key-positions = <2 35>; bindings = <&bt BT_SEL 2>; }; + combo_bt4 { timeout-ms = <50>; key-positions = <3 35>; bindings = <&bt BT_SEL 3>; }; + }; + macros { slash: slash { label = "SLASH"; @@ -91,7 +98,7 @@ label = "BASE"; &kp Q &kp W &kp F &kp P &kp B &kp J &kp L &kp U &kp Z &qmark &kp A &kp R &kp S &kp T &kp G &kp M &kp N &kp E &kp I &kp O &kp LSHFT &kp Y &kp X &kp C &kp D &kp V &kp K &kp H &slash &kp DOT &kp COMMA &kp ESC - &kp SPACE &mo UML &kp RET < BT LCTRL &kp LGUI &kp BSPC + &kp SPACE &mo UML &kp RET &kp LCTRL &kp LGUI &kp BSPC >; }; @@ -102,41 +109,20 @@ label = "UML"; // ┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┓ ┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┓ // ┃ 1 ┃ 2 ┃ 3 ┃ 4 ┃ 5 ┃ ┃ + ┃ @ ┃ Ü ┃ ┃ ~ ┃ // ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ -// ┃ Ä ┃ ┃ ß ┃ ┃ UP ┃ ┃ - ┃ < ┃ > ┃ ┃ Ö ┃ +// ┃ Ä ┃ ┃ ß ┃ UP ┃ ┃ ┃ - ┃ < ┃ > ┃ ┃ Ö ┃ // ┏━━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━━┓ -// ┃ ┃ ┃ LEFT ┃ ┃ DOWN ┃ RIGHT ┃ ┃ 6 ┃ 7 ┃ 8 ┃ 9 ┃ 0 ┃ ┃ +// ┃ ┃ ┃ ┃ LEFT ┃ DOWN ┃ RIGHT ┃ ┃ 6 ┃ 7 ┃ 8 ┃ 9 ┃ 0 ┃ ┃ // ┗━━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━━┛ // ┃ TAB ┃ trans ┃ ALT ┃ ┃ CTRL ┃ ( ┃ ) ┃ // ┗━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━┛ ┗━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━┛ bindings = < // ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp KP_PLUS &at &kp LBKT &lbrace &tilde - &kp SQT &none &kp MINUS &none &kp UP &kp FSLH &kp GRAVE >_sign &rbrace &kp SEMI -&trans &none &kp LEFT &none &kp DOWN &kp RIGHT &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp KP_MULTIPLY + &kp SQT &none &kp MINUS &kp UP &none &kp FSLH &kp GRAVE >_sign &rbrace &kp SEMI +&trans &none &none &kp LEFT &kp DOWN &kp RIGHT &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp KP_MULTIPLY &kp TAB &trans &kp LALT &kp LCTRL &lparen &rparen >; }; - bt_layer { -// ╔══════════════════════════════════════╗ -label = "BT"; -// ╚══════════════════════════════════════╝ -// ┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┓ ┏━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┓ -// ┃ BT1 ┃ BT2 ┃ BT3 ┃ BT4 ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ -// ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ -// ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ -// ┏━━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━━┓ -// ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ -// ┗━━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┫ ┣━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━╋━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━━┛ -// ┃ ┃ ┃ ┃ ┃ ┃ ┃ ┃ -// ┗━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━┛ ┗━━━━━━━━━━━┻━━━━━━━━━━━┻━━━━━━━━━━━┛ - bindings = < -// ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ ╷ -&bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &none &none &none &none &none &none - &none &none &none &none &none &none &none &none &none &none -&none &none &none &none &none &none &none &none &none &none &none &none - &none &none &none &trans &none &none - >; - }; }; };