Skip to content

Commit 641acfe

Browse files
added in urob's zmk-auto-layer for &num_word
1 parent 380a040 commit 641acfe

File tree

6 files changed

+79
-7
lines changed

6 files changed

+79
-7
lines changed

build_all_modules.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash
2+
# --- 1. Configuration ---
3+
ZMK_PATH="$HOME/zmk"
4+
CONFIG_PATH="$HOME/qmk/zmk/zmk-config.git/config"
5+
MODULES_PATH="$HOME/qmk/zmk/zmk-config.git/zmk-modules"
6+
EXTRA_MODULES="$MODULES_PATH/zmk-auto-layer"
7+
BOARD="nice_nano"
8+
DATE_STR=$(date +%Y-%m-%d_%H-%M)
9+
BASE_DEST="$HOME/Downloads/zmk_builds/$DATE_STR"
10+
# --- 2. The Build Function ---
11+
# This takes one argument: the name of the shield (e.g., "sofle" or "cradio")
12+
build_keyboard() {
13+
local SHIELD=$1
14+
echo "---------------------------------------"
15+
echo "🛠️ BUILDING $SHIELD"
16+
echo "---------------------------------------"
17+
# Build Left
18+
west build -p always -b "$BOARD" -d "build/$SHIELD/left" -- -DSHIELD="${SHIELD}_left" -DZMK_CONFIG="$CONFIG_PATH" -DZMK_EXTRA_MODULES="$EXTRA_MODULES"
19+
# Build Right
20+
west build -p always -b "$BOARD" -d "build/$SHIELD/right" -- -DSHIELD="${SHIELD}_right" -DZMK_CONFIG="$CONFIG_PATH" -DZMK_EXTRA_MODULES="$EXTRA_MODULES"
21+
# Create destination and copy files
22+
mkdir -p "$BASE_DEST/$SHIELD"
23+
cp "build/$SHIELD/left/zephyr/zmk.uf2" "$BASE_DEST/$SHIELD/${SHIELD}_left.uf2"
24+
cp "build/$SHIELD/right/zephyr/zmk.uf2" "$BASE_DEST/$SHIELD/${SHIELD}_right.uf2"
25+
}
26+
# --- 3. Execution ---
27+
cd "$ZMK_PATH" || exit
28+
source .venv/bin/activate
29+
cd app
30+
# Build your boards
31+
build_keyboard "sofle"
32+
build_keyboard "cradio"
33+
# --- 4. Cleanup & Notifications ---
34+
echo "---------------------------------------"
35+
echo "🧹 Cleaning up..."
36+
rm -rf build/
37+
# Desktop Notification (Linux)
38+
if command -v notify-send &>/dev/null; then
39+
notify-send "ZMK Build Complete" "Sofle and Sweep firmware are ready in Downloads." -i keyboard
40+
fi
41+
# Sound Alert (System Beep)
42+
echo -e "\a"
43+
echo "✅ ALL BUILDS COMPLETE"
44+
echo "📂 Location: $BASE_DEST"

config/behaviors.dtsi

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,24 @@
1414
#binding-cells = <0>;
1515
// expand the list to all the keys that you want caps word to not stop capping on
1616
// default is all the alphas and _ but it lacked minus which is annoying.
17-
continue-list = <UNDERSCORE BACKSPACE DELETE MINUS N1 N2 N3 N4 N5 N6 N7 N8 N9 N0>;
17+
continue-list = <UNDERSCORE BACKSPACE DELETE MINUS DOT N1 N2 N3 N4 N5 N6 N7 N8 N9 N0
18+
>;
1819
};
1920

2021
// caps_word_invert_on_shift lets it stay active while we un-caps while holding shift
2122
// might be useful with shift+bspc=del, worth consideration
2223

24+
// NUM word
25+
num_word: num_word {
26+
compatible = "zmk,behavior-auto-layer";
27+
#binding-cells =<1>;
28+
continue-list = <
29+
N0 N1 N2 N3 N4 N5 N6 N7 N8 N9
30+
BSPC DEL DOT COMMA
31+
PLUS MINUS STAR FSLH EQUAL UNDER
32+
>;
33+
};
34+
2335
// sticky keys fix - they linger on to long / i type to fast, ie. 2 keys get shifted or
2436
// whatever modifier when its only supposed to be one
2537
skq: sticky_key_quick_release {
@@ -34,6 +46,10 @@ skq: sticky_key_quick_release {
3446
// =====================================================================================
3547
// HOME_ROW_MODS
3648
// =====================================================================================
49+
// we might need slightly less quick tap terms
50+
// also double check the hold-trigger positions again.
51+
// possible also we ditch balanced and go for tap-preferred.
52+
3753
hml: homerow_mods_left {
3854
compatible = "zmk,behavior-hold-tap";
3955
#binding-cells = <2>;

config/combos.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
// layer locking, we can adjust this to allow on more layers as needed
3636
layers = <BASE 8>;
3737
};
38+
combo_yh_num_word {
39+
timeout-ms = <30>;
40+
key-positions = <0 1>;
41+
bindings = <&num_word LOWER>; // bindings set to 1 (we need 1 arg, ie. add the &num_word AND then 1 arg, which layer to swap to in this case. It should find LOWER if not put the value 2)
42+
layers = <BASE>;
43+
};
3844
combo_jk_esc {
3945
timeout-ms = <30>;
4046
key-positions = <0 1>;

config/west.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@ manifest:
66
url-base: https://github.com/zmkfirmware
77
# Additional modules containing boards/shields/custom code can be listed here as well
88
# See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects
9+
- name: urob
10+
url-base: https://github.com/urob
911
projects:
1012
- name: zmk
1113
remote: zmkfirmware
1214
import: app/west.yml
15+
- name: zmk-auto-layer
16+
remote: urob
17+
revision: main
1318
self:
1419
path: config

config/wrappers.dtsi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,15 @@
113113
* LOWER LAYER - Numbers and Media
114114
* --------------------------------------------------------------------------
115115
* 1 2 3 4 5 6 7 8 9 0
116-
* _ _ Vol+ Vol- Mute . 4 5 6 0
117-
* _ _ Prev Play Next + 1 2 3 -
116+
* _ _ Vol+ Vol- Mute . 4 5 6 ,
117+
* * _ Prev Play Next + 1 2 3 -
118118
*/
119-
#define ___LOWER_L1___ &kp N1 &kp N2 &kp N3 &kp N4 &kp N5
120-
#define ___LOWER_L2___ XXX XXX &kp C_VOL_UP &kp C_VOL_DN &kp C_MUTE
121-
#define ___LOWER_L3___ XXX XXX &kp C_PREV &kp C_PP &kp C_NEXT
119+
#define ___LOWER_L1___ &kp N1 &kp N2 &kp N3 &kp N4 &kp N5
120+
#define ___LOWER_L2___ &kp UNDER XXX &kp C_VOL_UP &kp C_VOL_DN &kp C_MUTE
121+
#define ___LOWER_L3___ &kp STAR XXX &kp C_PREV &kp C_PP &kp C_NEXT
122122

123123
#define ___LOWER_R1___ &kp N6 &kp N7 &kp N8 &kp N9 &kp N0
124-
#define ___LOWER_R2___ &kp DOT &kp N4 &kp N5 &kp N6 &kp N0
124+
#define ___LOWER_R2___ &kp DOT &kp N4 &kp N5 &kp N6 &kp COMMA
125125
#define ___LOWER_R3___ &kp PLUS &kp N1 &kp N2 &kp N3 &kp MINUS
126126

127127
/* --------------------------------------------------------------------------

zmk-modules/zmk-auto-layer

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit dfa7c695ffde41ef8064245453595d50e198ae1d

0 commit comments

Comments
 (0)