Skip to content

Commit

Permalink
Merge branch 'main' of github.com:urob/zmk-config
Browse files Browse the repository at this point in the history
  • Loading branch information
AW3i committed Dec 2, 2024
2 parents 4544e24 + de82502 commit 347ed60
Show file tree
Hide file tree
Showing 11 changed files with 80 additions and 74 deletions.
10 changes: 5 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ _parse_combos:
# parse build.yaml and filter targets by expression
_parse_targets $expr:
#!/usr/bin/env bash
attrs="[.board, .shield]"
attrs="[.board, .shield, .snippet]"
filter="(($attrs | map(. // [.]) | combinations), ((.include // {})[] | $attrs)) | join(\",\")"
echo "$(yq -r "$filter" build.yaml | grep -v "^," | grep -i "${expr/#all/.*}")"
# build firmware for single board & shield combination
_build_single $board $shield *west_args:
_build_single $board $shield $snippet *west_args:
#!/usr/bin/env bash
set -euo pipefail
artifact="${shield:+${shield// /+}-}${board}"
build_dir="{{ build / '$artifact' }}"
echo "Building firmware for $artifact..."
west build -s zmk/app -d "$build_dir" -b $board {{ west_args }} -- \
west build -s zmk/app -d "$build_dir" -b $board {{ west_args }} ${snippet:+-S "$snippet"} -- \
-DZMK_CONFIG="{{ config }}" ${shield:+-DSHIELD="$shield"}

if [[ -f "$build_dir/zephyr/zmk.uf2" ]]; then
Expand All @@ -64,8 +64,8 @@ build expr *west_args: _parse_combos
targets=$(just _parse_targets {{ expr }})
[[ -z $targets ]] && echo "No matching targets found. Aborting..." >&2 && exit 1
echo "$targets" | while IFS=, read -r board shield; do
just _build_single "$board" "$shield" {{ west_args }}
echo "$targets" | while IFS=, read -r board shield snippet; do
just _build_single "$board" "$shield" "$snippet" {{ west_args }}
done

# clear build cache and artifacts
Expand Down
14 changes: 4 additions & 10 deletions config/base.keymap
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <behaviors.dtsi>
#include <behaviors/num_word.dtsi> // requires auto-layer module
#include <behaviors/leader_key.dtsi> // requires leader-key module
#include <dt-bindings/zmk/keys.h>
#ifdef CONFIG_WIRELESS
#include <dt-bindings/zmk/bt.h>
Expand Down Expand Up @@ -203,13 +204,6 @@ ZMK_TAP_DANCE(copy_cut,
bindings = <&kp LC(INS)>, <&kp LC(X)>;
)

// Windows sleep key
ZMK_MACRO(win_sleep,
wait-ms = <500>;
tap-ms = <50>;
bindings = <&kp LG(X) &kp U &kp S>;
)

// Sticky shift + leader
ZMK_MACRO(leader_sft, bindings = <&sk LSHFT &leader>;)

Expand Down Expand Up @@ -252,16 +246,16 @@ ZMK_LAYER(nav,

ZMK_LAYER(fn,
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
X_LT &kp F10 &kp F1 &kp F2 &kp F3 ___ X_MT ___ &kp C_PREV &kp C_VOL_UP &kp C_NEXT &win_sleep X_RT
X_LT &kp F12 &kp F7 &kp F8 &kp F9 ___ X_MT ___ &kp C_PREV &kp C_VOL_UP &kp C_NEXT &kp SYSTEM_SLEEP X_RT
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LM &hml LGUI F11 &hml LALT F4 &hml LSHFT F5 &hml LCTRL F6 ___ X_MM ___ DSK_PREV VOL_DOWN DSK_NEXT ___ X_RM
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LB &kp F12 &kp F7 &kp F8 &kp F9 ___ X_MB PIN_APP PIN_WIN DSK_MGR ___ ___ X_RB
X_LB &kp F10 &kp F1 &kp F2 &kp F3 ___ X_MB PIN_APP PIN_WIN DSK_MGR ___ ___ X_RB
//├──────┤ ╰─────────────┼─────────────┴─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┴───────────────────────────╯ ├──────┤
X_LH ___ ___ X_MH &kp C_MUTE &kp C_PP X_RH
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
)

wekk
ZMK_LAYER(num,
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
X_LT ___ &kp N1 &kp N2 &kp N3 ___ X_MT ___ &kp N1 &kp N2 &kp N3 ___ X_RT
Expand Down
13 changes: 8 additions & 5 deletions config/corneish_zen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000

# Enable mouse
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_MOUSE_SMOOTH_SCROLLING=y

# Zen display tweaks, requires patches by caksoylar
CONFIG_ZMK_DISPLAY_FULL_REFRESH_PERIOD=300
CONFIG_ZMK_DISPLAY_HIDE_MOMENTARY_LAYERS=y
CONFIG_CUSTOM_WIDGET_LAYER_STATUS_HIDE_HEADING=y
# Enable generic desktop usages
CONFIG_ZMK_HID_GENERIC_DESKTOP_USAGES_BASIC=y

# Combo config, automated by build script
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=6
Expand All @@ -18,8 +17,12 @@ CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=3
CONFIG_ZMK_LEADER_MAX_SEQUENCES_PER_KEY=27
CONFIG_ZMK_LEADER_MAX_KEYS_PER_SEQUENCE=2

# Zen display tweaks, requires patches by caksoylar
CONFIG_ZMK_DISPLAY_FULL_REFRESH_PERIOD=300
CONFIG_ZMK_DISPLAY_HIDE_MOMENTARY_LAYERS=y
CONFIG_CUSTOM_WIDGET_LAYER_STATUS_HIDE_HEADING=y

# Bluetooth tweaks
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y

2 changes: 1 addition & 1 deletion config/corneish_zen.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
#include "base.keymap"

/* use 5-column layout for Zen */
ZMK_APPLY_MATRIX_TRANSFORM(five_column_transform)
/{ chosen { zmk,physical-layout = &foostan_corne_5col_layout; }; };
5 changes: 4 additions & 1 deletion config/glove80.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000

# Enable mouse
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_MOUSE_SMOOTH_SCROLLING=y

# Generic desktop usages
CONFIG_ZMK_HID_GENERIC_DESKTOP_USAGES_BASIC=y

# Combo config, automated by build script
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=6
Expand All @@ -19,4 +23,3 @@ CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
CONFIG_BT_MAX_CONN=3
CONFIG_BT_MAX_PAIRED=3

8 changes: 4 additions & 4 deletions config/leader.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ tapping the leader key. */

/* German umlauts */

ZMK_LEADER_SEQUENCE(de_ae, &de_ae, LM4 RM2) // ä
ZMK_LEADER_SEQUENCE(de_oe, &de_oe, RM4 RM2) // ö
ZMK_LEADER_SEQUENCE(de_ue, &de_ue, RT2 RM2) // ü
ZMK_LEADER_SEQUENCE(de_eszett, &de_eszett, LM2 LM2) // ß
ZMK_LEADER_SEQUENCE(de_ae, &de_ae, LM4) // ä
ZMK_LEADER_SEQUENCE(de_oe, &de_oe, RM4) // ö
ZMK_LEADER_SEQUENCE(de_ue, &de_ue, RT2) // ü
ZMK_LEADER_SEQUENCE(de_eszett, &de_eszett, LM2) // ß

/* Greek letters */

Expand Down
10 changes: 7 additions & 3 deletions config/planck_rev6.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
CONFIG_ZMK_KEYBOARD_NAME="Planck Rev6"

# Enable mouse
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_MOUSE_SMOOTH_SCROLLING=y

# Enable generic desktop usages
CONFIG_ZMK_HID_GENERIC_DESKTOP_USAGES_BASIC=y

# Combo config, automated by build script
CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=6
CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO=3

# Leader config, automated by build script
CONFIG_ZMK_LEADER_MAX_SEQUENCES_PER_KEY=27
CONFIG_ZMK_LEADER_MAX_KEYS_PER_SEQUENCE=2

# Enable mouse
CONFIG_ZMK_MOUSE=y
11 changes: 5 additions & 6 deletions config/west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
manifest:
defaults:
remote: urob
revision: main

remotes:
- name: upstream
Expand All @@ -28,20 +29,18 @@ manifest:
url-base: https://github.com/urob

projects:
- name: zmk-helpers
revision: main
path: modules/helpers
- name: zmk-auto-layer
revision: main
path: modules/auto-layer
- name: zmk-helpers
path: modules/helpers
- name: zmk-leader-key
path: modules/leader-key
- name: zmk-tri-state
revision: main
path: modules/tri-state

# ZMK with Zephyr namespaced under /zmk. This requires that ZMK imports
# Zephyr with a path other than `zephyr` (as in `going-modular`).
- name: zmk
revision: going-modular
path: .
import:
file: app/west.yml
Expand Down
8 changes: 2 additions & 6 deletions draw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@
}:
buildPythonApplication rec {
pname = "keymap-drawer";
version = "0.18.0";
version = "0.18.1";
pyproject = true;

src = fetchPypi {
pname = "keymap_drawer";
inherit version;
hash = "sha256-faJB+cjj740Ny2wqVwc5t/+grEWBIEyhex3RoLCuIs8=";
hash = "sha256-MHjxsopXoYWZFuXUbeaI7BCSx3HkRaeVidY+mc8lj+s=";
};

postPatch = ''
substituteInPlace pyproject.toml --replace 'platformdirs = "^3.5.1"' 'platformdirs = "^4.0.0"'
'';

build-system = [poetry-core];

propagatedBuildInputs = [
Expand Down
69 changes: 39 additions & 30 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
# Zephyr sdk and toolchain
zephyr-nix.url = "github:urob/zephyr-nix";
zephyr-nix.inputs.zephyr.follows = "zephyr";
# Relies on 23.11 to provide py38 until zephyr-sdk bumps the requirement
# https://github.com/zephyrproject-rtos/sdk-ng/issues/752
# zephyr-nix.inputs.nixpkgs.follows = "nixpkgs";
zephyr-nix.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { nixpkgs, zephyr-nix, ... }: let
Expand Down

0 comments on commit 347ed60

Please sign in to comment.