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 17, 2024
2 parents 86a2d4b + a01682b commit 5ff487e
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 122 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
.west
modules
firmware
zephyr
zmk
# Ignore keymap-drawer output for now
draw/base.svg
Expand Down
16 changes: 6 additions & 10 deletions config/base.keymap
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#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>
#include <dt-bindings/zmk/outputs.h>
#define _BT_SEL_KEYS_ &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_CLR
#else
#define _BT_SEL_KEYS_ &trans &trans &trans &trans &trans
Expand Down Expand Up @@ -44,10 +44,6 @@
quick-tap-ms = <QUICK_TAP_MS>;
};

&leader { // leader-key config
timeout-ms = <650>;
};

/* Homerow mods */

#define KEYS_L LT0 LT1 LT2 LT3 LT4 LM0 LM1 LM2 LM3 LM4 LB0 LB1 LB2 LB3 LB4 // left hand
Expand Down Expand Up @@ -246,7 +242,7 @@ ZMK_LAYER(nav,

ZMK_LAYER(fn,
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
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_LT &kp F12 &kp F7 &kp F8 &kp F9 ___ X_MT ___ &kp C_PREV &kp C_VOL_UP &kp C_NEXT ___ 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
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
Expand Down Expand Up @@ -282,13 +278,13 @@ ZMK_LAYER(sys,

ZMK_LAYER(mouse,
//╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮ ╭─────────────┬─────────────┬─────────────┬─────────────┬─────────────╮ ╭──────╮
X_LT ___ ___ ___ ___ ___ X_MT U_WH_L U_WH_D U_MS_U U_WH_U U_WH_R X_RT
X_LT ___ ___ ___ ___ ___ X_MT ___ &kp PG_UP U_MS_U &kp PG_DN ___ X_RT
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LM ___ ___ ___ ___ ___ X_MM ___ U_MS_L U_MS_D U_MS_R ___ X_RM
X_LM ___ ___ ___ ___ ___ X_MM U_WH_L U_MS_L U_MS_D U_MS_R U_WH_R X_RM
//├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┼─────────────┼─────────────┤ ├──────┤
X_LB ___ ___ ___ ___ ___ X_MB ___ &mkp MB4 &mkp MCLK &mkp MB5 ___ X_RB
X_LB ___ ___ ___ ___ ___ X_MB ___ &mkp LCLK &mkp MCLK &mkp RCLK ___ X_RB
//├──────┤ ╰─────────────┼─────────────┴─────────────┼─────────────┼─────────────┤ ├──────┤ ├─────────────┼─────────────┼─────────────┴───────────────────────────╯ ├──────┤
X_LH ___ ___ X_MH &mkp LCLK &mkp RCLK X_RH
X_LH ___ ___ X_MH U_WH_U U_WH_D X_RH
//╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯ ╰─────────────┴─────────────╯ ╰──────╯
)

Expand Down
18 changes: 5 additions & 13 deletions config/corneish_zen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,16 @@ CONFIG_ZMK_SLEEP=y
CONFIG_ZMK_IDLE_SLEEP_TIMEOUT=1800000

# Enable mouse
CONFIG_ZMK_MOUSE=y
CONFIG_ZMK_MOUSE_SMOOTH_SCROLLING=y

# Enable generic desktop usages
CONFIG_ZMK_HID_GENERIC_DESKTOP_USAGES_BASIC=y
CONFIG_ZMK_POINTING=y
CONFIG_ZMK_POINTING_SMOOTH_SCROLLING=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

# 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
# Don't show layer status
#CONFIG_CUSTOM_WIDGET_BATTERY_STATUS=n
CONFIG_CUSTOM_WIDGET_LAYER_STATUS=n

# Bluetooth tweaks
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
Expand Down
11 changes: 2 additions & 9 deletions config/glove80.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,13 @@ CONFIG_ZMK_SLEEP=y
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
CONFIG_ZMK_POINTING=y
CONFIG_ZMK_POINTING_SMOOTH_SCROLLING=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

# Bluetooth tweaks
CONFIG_ZMK_BLE_EXPERIMENTAL_CONN=y
CONFIG_BT_GATT_ENFORCE_SUBSCRIPTION=n
Expand Down
91 changes: 50 additions & 41 deletions config/leader.dtsi
Original file line number Diff line number Diff line change
@@ -1,47 +1,56 @@
/* KEY POSITIONS
╭─────────────────────╮ ╭─────────────────────╮
│ LT4 LT3 LT2 LT1 LT0 │ │ RT0 RT1 RT2 RT3 RT4 │
│ LM4 LM3 LM2 LM1 LM0 │ │ RM0 RM1 RM2 RM3 RM4 │
│ LB4 LB3 LB2 LB1 LB0 │ │ RB0 RB1 RB2 RB3 RB4 │
╰───────╮ LH2 LH1 LH0 │ │ RH0 RH1 RH2 ╭───────╯
╰─────────────╯ ╰─────────────╯
Note: The leader sequence must be pressed exactly as defined to be triggered.
To capitalize a letter, hold the shift key (or tap sticky-shift) *before*
tapping the leader key. */
#undef ZMK_LEADER_SEQUENCE
#define ZMK_LEADER_SEQUENCE(name, leader_bindings, leader_sequence) \
/ { \
behaviors { \
leader: leader { \
compatible = "zmk,behavior-leader-key"; \
#binding-cells = <0>; \
ignore-keys = <LSHFT RSHFT>; \
leader_sequence_ ## name { \
bindings = <leader_bindings>; \
sequence = <leader_sequence>; \
}; \
}; \
}; \
};

/* German umlauts */

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) // ß
ZMK_LEADER_SEQUENCE(de_ae, &de_ae, A) // ä
ZMK_LEADER_SEQUENCE(de_oe, &de_oe, O) // ö
ZMK_LEADER_SEQUENCE(de_ue, &de_ue, U) // ü
ZMK_LEADER_SEQUENCE(de_eszett, &de_eszett, S) // ß

/* Greek letters */
ZMK_LEADER_SEQUENCE(el_alpha, &el_alpha, E A) // α
ZMK_LEADER_SEQUENCE(el_beta, &el_beta, E B) // β
ZMK_LEADER_SEQUENCE(el_gamma, &el_gamma, E G) // γ
ZMK_LEADER_SEQUENCE(el_delta, &el_delta, E D) // δ
ZMK_LEADER_SEQUENCE(el_epsilon, &el_epsilon, E E) // ε
ZMK_LEADER_SEQUENCE(el_zeta, &el_zeta, E Z) // ζ
ZMK_LEADER_SEQUENCE(el_eta, &el_eta, E H) // η
ZMK_LEADER_SEQUENCE(el_theta, &el_theta, E V) // θ
ZMK_LEADER_SEQUENCE(el_iota, &el_iota, E I) // ι
ZMK_LEADER_SEQUENCE(el_kappa, &el_kappa, E K) // κ
ZMK_LEADER_SEQUENCE(el_lambda, &el_lambda, E L) // λ
ZMK_LEADER_SEQUENCE(el_mu, &el_mu, E M) // μ
ZMK_LEADER_SEQUENCE(el_nu, &el_nu, E N) // ν
ZMK_LEADER_SEQUENCE(el_xi, &el_xi, E X) // ξ
ZMK_LEADER_SEQUENCE(el_omikron, &el_omikron, E O) // ο
ZMK_LEADER_SEQUENCE(el_pi, &el_pi, E P) // π
ZMK_LEADER_SEQUENCE(el_rho, &el_rho, E R) // ρ
ZMK_LEADER_SEQUENCE(el_sigma, &el_sigma, E S) // σ
ZMK_LEADER_SEQUENCE(el_tau, &el_tau, E T) // τ
ZMK_LEADER_SEQUENCE(el_upsilon, &el_upsilon, E U) // υ
ZMK_LEADER_SEQUENCE(el_phi, &el_phi, E F) // ϕ
ZMK_LEADER_SEQUENCE(el_chi, &el_chi, E C) // χ
ZMK_LEADER_SEQUENCE(el_psi, &el_psi, E Y) // ψ
ZMK_LEADER_SEQUENCE(el_omega, &el_omega, E W) // ω

ZMK_LEADER_SEQUENCE(el_alpha, &el_alpha, RM2 LM4) // α
ZMK_LEADER_SEQUENCE(el_beta, &el_beta, RM2 LT0) // β
ZMK_LEADER_SEQUENCE(el_gamma, &el_gamma, RM2 LM0) // γ
ZMK_LEADER_SEQUENCE(el_delta, &el_delta, RM2 LB1) // δ
ZMK_LEADER_SEQUENCE(el_epsilon, &el_epsilon, RM2 RM2) // ε
ZMK_LEADER_SEQUENCE(el_zeta, &el_zeta, RM2 LB4) // ζ
ZMK_LEADER_SEQUENCE(el_eta, &el_eta, RM2 RB1) // η
ZMK_LEADER_SEQUENCE(el_theta, &el_theta, RM2 LB0) // θ
ZMK_LEADER_SEQUENCE(el_iota, &el_iota, RM2 RM3) // ι
ZMK_LEADER_SEQUENCE(el_kappa, &el_kappa, RM2 RB0) // κ
ZMK_LEADER_SEQUENCE(el_lambda, &el_lambda, RM2 RT1) // λ
ZMK_LEADER_SEQUENCE(el_mu, &el_mu, RM2 RM0) // μ
ZMK_LEADER_SEQUENCE(el_nu, &el_nu, RM2 RM1) // ν
ZMK_LEADER_SEQUENCE(el_xi, &el_xi, RM2 LB3) // ξ
ZMK_LEADER_SEQUENCE(el_omikron, &el_omikron, RM2 RM4) // ο
ZMK_LEADER_SEQUENCE(el_pi, &el_pi, RM2 LT1) // π
ZMK_LEADER_SEQUENCE(el_rho, &el_rho, RM2 LM3) // ρ
ZMK_LEADER_SEQUENCE(el_sigma, &el_sigma, RM2 LM2) // σ
ZMK_LEADER_SEQUENCE(el_tau, &el_tau, RM2 LM1) // τ
ZMK_LEADER_SEQUENCE(el_upsilon, &el_upsilon, RM2 RT2) // υ
ZMK_LEADER_SEQUENCE(el_phi, &el_phi, RM2 LT2) // ϕ
ZMK_LEADER_SEQUENCE(el_chi, &el_chi, RM2 LB2) // χ
ZMK_LEADER_SEQUENCE(el_psi, &el_psi, RM2 RT3) // ψ
ZMK_LEADER_SEQUENCE(el_omega, &el_omega, RM2 LT3) // ω
// BLE and USB
#ifdef CONFIG_WIRELESS
ZMK_LEADER_SEQUENCE(usb, &out OUT_USB, U S B)
ZMK_LEADER_SEQUENCE(ble, &out OUT_BLE, B L E)
#endif // CONFIG_WIRELESS
ZMK_LEADER_SEQUENCE(reset, &sys_reset, R E S E T)
ZMK_LEADER_SEQUENCE(boot, &bootloader, B O O T)

20 changes: 10 additions & 10 deletions config/mouse.dtsi
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#define ZMK_MOUSE_DEFAULT_MOVE_VAL 1500 // 600
#define ZMK_MOUSE_DEFAULT_SCRL_VAL 20 // 10
// Settings tuned for 3840 x 2160 display resolution
#define ZMK_POINTING_DEFAULT_MOVE_VAL 1500 // 600
#define ZMK_POINTING_DEFAULT_SCRL_VAL 120 // 10

#include <dt-bindings/zmk/mouse.h>
#include <dt-bindings/zmk/pointing.h>

// Config from @caksoylar, defaults in comments
&mmv {
acceleration-exponent = <1>; // 1
time-to-max-speed-ms = <500>; // 300
delay-ms = <0>; // 0
acceleration-exponent = <1>; // 1
time-to-max-speed-ms = <500>; // 300
delay-ms = <0>; // 0
};

&msc {
acceleration-exponent = <1>; // 0
time-to-max-speed-ms = <40>; // 300
delay-ms = <0>; // 0
acceleration-exponent = <1>; // 0
time-to-max-speed-ms = <800>; // 300
delay-ms = <0>; // 0
};

#define U_MS_U &mmv MOVE_UP
Expand All @@ -24,4 +25,3 @@
#define U_WH_D &msc SCRL_DOWN
#define U_WH_L &msc SCRL_LEFT
#define U_WH_R &msc SCRL_RIGHT

11 changes: 2 additions & 9 deletions config/planck_rev6.conf
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
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
CONFIG_ZMK_POINTING=y
CONFIG_ZMK_POINTING_SMOOTH_SCROLLING=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
63 changes: 45 additions & 18 deletions config/west.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# This file specifies the build dependencies for Github Action workflows and
# for local build environments. The workspace has three toplevel directories
# containing the user config, user modules and ZMK. Zephyr and its dependencies
# are namespaced under /zmk to keep the toplevel clean.
# for local build environments. The workspace has four toplevel directories
# containing the user config, modules, zephy and ZMK.
#
# ZMK-Workspace
# ├── config
# ├── modules (user modules)
# ├── modules
# ├── zephyr
# └── zmk
# └── modules (Zephyr modules)
#
# To create a local build environment, clone this repository and then run the
# following commands from its toplevel directory:
Expand All @@ -20,31 +19,59 @@
manifest:
defaults:
remote: urob
revision: main
revision: v0.1 # Pin everything to v0.1

remotes:
- name: upstream
url-base: https://github.com/zmkfirmware
- name: urob
url-base: https://github.com/urob
- name: zmkfirmware
url-base: https://github.com/zmkfirmware

projects:
# This is vanilla ZMK - just using my remote to pin the current state of main,
# as upstream hasn't yet released a version with mouse.
- name: zmk
revision: v0.1+mouse
import: app/west.yml

# ZMK modules
- name: zmk-adaptive-key
path: modules/zmk/adaptive-key
- name: zmk-auto-layer
path: modules/auto-layer
path: modules/zmk/auto-layer
- name: zmk-helpers
path: modules/helpers
path: modules/zmk/helpers
- name: zmk-leader-key
path: modules/leader-key
revision: v0.1+locality
path: modules/zmk/leader-key
- name: zmk-tri-state
path: modules/tri-state
path: modules/zmk/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
path: .
# Temporarily overload Zephyr until
# https://github.com/zmkfirmware/zephyr/pull/40 is merged.
- name: zephyr
revision: v3.5.0+zmk-fixes
clone-depth: 1
import:
file: app/west.yml
path-prefix: zmk
name-blocklist:
- ci-tools
- hal_altera
- hal_cypress
- hal_infineon
- hal_microchip
- hal_nxp
- hal_openisa
- hal_silabs
- hal_xtensa
- hal_st
- hal_ti
- loramac-node
- mcuboot
- mcumgr
- net-tools
- openthread
- edtt
- trusted-firmware-m

self:
path: config
24 changes: 12 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ This is my personal [ZMK firmware](https://github.com/zmkfirmware/zmk/)
configuration. It consists of a 34-keys base layout that is re-used for various
boards, including my Corneish Zen and my Planck.

This branch is updated for the latest ZMK using Zephyr 3.5. A legacy version
compatible with Zephyr 3.0 is available
[here](https://github.com/urob/zmk-config/tree/main-zephyr-3.0).
My configuration builds against `v0.1` of upstream ZMK plus a backport of the
merged pointer PR. Custom functionality is added through various ZMK modules.
The state of the entire firmware is pinned in my `west`
[manifest](https://github.com/urob/zmk-config/blob/main/config/west.yml).

## Highlights

Expand Down Expand Up @@ -245,13 +246,12 @@ one-handed Alt-Tab switcher (`PWin` and `NWin`).

##### Leader key

I recently started using Nick Conway's
[Leader key](https://github.com/zmkfirmware/zmk/pull/1380) implementation for
ZMK. From my limited experience, I really like how it allows making less
commonly used behaviors accessible without binding them to a dedicated key. For
now I am using it for a variety of Unicode math symbols and international
characters. I am planning to extend the use to various firmware interactions
once I figure out the technical details.
I am using my own implementation of a
[Leader key](https://github.com/urob/zmk-leader-key) to bind less common
functionality without giving up dedicated keys. Currently, I am using leader
sequences for various system and output controls. I am also using leader key
sequences for convenient access to various Unicode math symbols and
international characters.

## Local development workspace

Expand Down Expand Up @@ -403,8 +403,8 @@ remaining issues:
([#544](https://github.com/zmkfirmware/zmk/issues/544)), requiring a brief
pause when wanting to chord HRMs that overlap with combo positions. As a
workaround, I implemented all homerow combos as homerow-mod-combos. This is
good enough for day-to-day, but does not address all edge cases (eg
changing active mods).
good enough for day-to-day, but does not address all edge cases (eg changing
active mods).
- Very minor: `&bootloader` doesn't work with stm32 boards like the Planck
([#1086](https://github.com/zmkfirmware/zmk/issues/1086))

Expand Down

0 comments on commit 5ff487e

Please sign in to comment.