Skip to content

Repository files navigation

ZMK Module: Default Layer

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.

Features

  • Persistent Default Layer: Use the &df X behavior to set layer X as 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).

Installation

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

Usage

  1. Include the behavior definitions at the top of your .keymap file (or wherever you define your behaviors):
#include "elpekenin/behaviors.dtsi"
  1. Map the behavior in your keymap. For example, to set layer 1 as the new default layer:
bindings = <&df 1>;

License

This project is licensed under the MIT License.

About

Add a default layer behavior for each BT profile (forked from zmk-userspace)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages