Note: This repository is a customized fork of elpekenin/zmk-userspace.
This repository is a Zephyr module designed to be used with ZMK Firmware. It provides a custom behavior (&df) to change the base layer of the keyboard dynamically, with the state being remembered across reboots and connections.
- Persistent Default Layer: Use the
&df Xbehavior to set layerXas the new default layer for the current connection. This setting is stored persistently, meaning the keyboard will remain on this base layer even after restarting or powering off the board. - Connection-Specific Storage: The default layer is tied to the current active Bluetooth profile (or USB). This allows you to automatically load different base layers depending on which device you are connected to (e.g. Mac vs. Windows).
To use this module, you need to add it to your ZMK configuration repository's west.yml file (usually located in the config/ directory).
Open your west.yml, add the remote where this repository is hosted, and add the module to the projects list.
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
# Add the remote where this repository is hosted
- name: MickiusMousius
url-base: https://github.com/MickiusMousius
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
# Add this module
- name: zmk-defaultlayer
remote: MickiusMousius
revision: main
self:
path: config- Include the behavior definitions at the top of your
.keymapfile (or wherever you define your behaviors):
#include "elpekenin/behaviors.dtsi"- Map the behavior in your keymap. For example, to set layer 1 as the new default layer:
bindings = <&df 1>;
This project is licensed under the MIT License.