summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/docs/assets/dev-setup/vscode_devcontainer.pngbin0 -> 20773 bytes
-rw-r--r--docs/docs/behavior/power.md64
-rw-r--r--docs/docs/customization.md28
-rw-r--r--docs/docs/dev-build.md13
-rw-r--r--docs/docs/dev-guide-new-shield.md200
-rw-r--r--docs/docs/dev-setup.md83
-rw-r--r--docs/docs/hardware.md2
-rw-r--r--docs/docs/user-setup.md7
-rw-r--r--docs/sidebars.js1
-rw-r--r--docs/static/setup.ps121
-rw-r--r--docs/static/setup.sh16
11 files changed, 417 insertions, 18 deletions
diff --git a/docs/docs/assets/dev-setup/vscode_devcontainer.png b/docs/docs/assets/dev-setup/vscode_devcontainer.png
new file mode 100644
index 0000000..e5c22b0
--- /dev/null
+++ b/docs/docs/assets/dev-setup/vscode_devcontainer.png
Binary files differ
diff --git a/docs/docs/behavior/power.md b/docs/docs/behavior/power.md
new file mode 100644
index 0000000..6b8237b
--- /dev/null
+++ b/docs/docs/behavior/power.md
@@ -0,0 +1,64 @@
+---
+title: Power Management Behaviors
+sidebar_label: Power Management
+---
+
+## Summary
+
+These page contains some of the power management behaviors currently supported by ZMK.
+
+## External Power Control
+
+The External power control behavior allows enabling or disabling the VCC power output
+to save power. Some of the LEDs will consume power even in OFF state. To preserve
+battery life in this scenario, some controller boards have support to disable the
+external power completely.
+
+The following boards currently support this feature:
+- nRFMicro
+- nice!nano
+
+## External Power Control Command Defines
+
+External power control command defines are provided through the [`dt-bindings/zmk/ext_power.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/ext_power.h) header,
+which is added at the top of the keymap file:
+
+```
+#include <dt-bindings/zmk/ext_power.h>
+```
+
+This will allow you to reference the actions defined in this header such as `EXT_POWER_OFF_CMD`.
+
+Here is a table describing the command for each define:
+
+| Define | Action | Alias |
+| ------------ | -------------------------------------- | -------- |
+| `EXT_POWER_OFF_CMD` | Disable the external power. | `EP_OFF` |
+| `EXT_POWER_ON_CMD` | Enable the external power. | `EP_ON` |
+| `EXT_POWER_TOGGLE_CMD` | Toggle the external power. | `EP_TOG` |
+
+### Behavior Binding
+
+- Reference: `&ext_power`
+- Parameter#1: Command, e.g `EP_ON`
+
+### Example:
+
+1. Behavior binding to enable the external power
+
+ ```
+ &ext_power EP_ON
+ ```
+
+1. Behavior binding to disable the external power
+
+ ```
+ &ext_power EP_OFF
+ ```
+
+1. Behavior binding to toggle the external power
+
+ ```
+ &ext_power EP_TOG
+ ```
+
diff --git a/docs/docs/customization.md b/docs/docs/customization.md
index 0bb1794..261c40d 100644
--- a/docs/docs/customization.md
+++ b/docs/docs/customization.md
@@ -1,10 +1,21 @@
---
id: customization
-title: Customizing ZMK
+title: Customizing ZMK/`zmk-config` folders
sidebar_label: Customizing ZMK
---
After verifying you can successfully flash the default firmware, you will probably want to begin customizing your keymap and other keyboard options.
+[In the initial setup tutorial](user-setup), you created a Github repository called `zmk-config`. This repository is a discrete filesystem which works
+with the main `zmk` firmware repository to build your desired firmware. The main advantage of a discrete configuration folder is ensuring that the
+working components of ZMK are kept separate from your personal keyboard settings, reducing the amount of file manipulation in the configuration process.
+This makes flashing ZMK to your keyboard much easier, especially because you don't need to keep an up-to-date copy of zmk on your computer at all times.
+
+On default `zmk-config` folder should contain two files:
+* `<shield>.conf`
+* `<shield>`.keymap
+
+However, your config folder can also be modified to include a `boards/` directory for keymaps and configurations for multiple boards/shields
+outside of the default keyboard setting definitions.
## Configuration Changes
@@ -26,8 +37,23 @@ GitHub Actions job to build your firmware which you can download once it complet
If you need to, a review of [Learn The Basics Of Git In Under 10 Minutes](https://www.freecodecamp.org/news/learn-the-basics-of-git-in-under-10-minutes-da548267cc91/) will help you get these steps right.
:::
+## Building from a local `zmk` fork using `zmk-config`
+
+[As outlined here](dev-build-flash), firmware comes in the form of .uf2 files, which can be built locally using the command `west build`. Normally,
+`west build` will default to using the in-tree .keymap and .conf files found in your local copy of the `zmk` repository. However, you can append the command, `-DZMK_CONFIG="C:/the/absolute/path/config"` to `west build` in order to use the contents of your `zmk-config` folder instead of the
+default keyboard settings.
+ **Notice that this path should point to the folder labelled `config` within your `zmk-config` folder.**
+
+
+For instance, building kyria firmware from a user `myUser`'s `zmk-config` folder on Windows 10 may look something like this:
+
+```
+west build -b nice_nano -- -DSHIELD=kyria_left -DZMK_CONFIG="C:/Users/myUser/Documents/Github/zmk-config/config"
+```
+
## Flashing Your Changes
For normal keyboards, follow the same flashing instructions as before to flash your updated firmware.
For split keyboards, only the central (left) side will need to be reflashed if you are just updating your keymap.
+More troubleshooting information for split keyboards can be found [here](troubleshooting#split-keyboard-halves-unable-to-pair).
diff --git a/docs/docs/dev-build.md b/docs/docs/dev-build.md
index 816468e..83ed8cb 100644
--- a/docs/docs/dev-build.md
+++ b/docs/docs/dev-build.md
@@ -84,6 +84,19 @@ west build -d build/right -b nice_nano -- -DSHIELD=kyria_right
```
This produces `left` and `right` subfolders under the `build` directory and two separate .uf2 files. For future work on a specific half, use the `-d` parameter again to ensure you are building into the correct location.
+### Building from `zmk-config` Folder
+
+Instead of building .uf2 files using the default keymap and config files, you can build directly from your [`zmk-config` folder](user-setup#github-repo) by adding
+`-DZMK_CONFIG="C:/the/absolute/path/config"` to your `west build` command. **Notice that this path should point to the folder labelled `config` within your `zmk-config` folder.**
+
+
+For instance, building kyria firmware from a user `myUser`'s `zmk-config` folder on Windows 10 may look something like this:
+
+```
+west build -b nice_nano -- -DSHIELD=kyria_left -DZMK_CONFIG="C:/Users/myUser/Documents/Github/zmk-config/config"
+```
+
+
## Flashing
Once built, the previously supplied parameters will be remembered so you can run the following to flash your
diff --git a/docs/docs/dev-guide-new-shield.md b/docs/docs/dev-guide-new-shield.md
index 1ba572c..9f7b23c 100644
--- a/docs/docs/dev-guide-new-shield.md
+++ b/docs/docs/dev-guide-new-shield.md
@@ -21,6 +21,10 @@ The high level steps are:
It may be helpful to review the upstream [shields documentation](https://docs.zephyrproject.org/2.3.0/guides/porting/shields.html#shields) to get a proper understanding of the underlying system before continuing.
+:::note
+ZMK support for split keyboards requires a few more files than single boards to ensure proper connectivity between the central and peripheral units. Check the following guides thoroughly to ensure that all the files are in place.
+:::
+
## New Shield Directory
Shields for Zephyr applications go into the `boards/shields/` directory; since ZMK's Zephyr application lives in the `app/` subdirectory of the repository, that means the new shield directory should be:
@@ -45,6 +49,16 @@ config SHIELD_MY_BOARD
This will make sure the new configuration `SHIELD_MY_BOARD` is set to true whenever `my_board` is added as a shield in your build.
+
+**For split boards**, you will need to add configurations for the left and right sides.
+```
+config SHIELD_MY_BOARD_LEFT
+ def_bool $(shields_list_contains,my_board_left)
+
+config SHIELD_MY_BOARD_RIGHT
+ def_bool $(shields_list_contains,my_board_right)
+```
+
### Kconfig.defconfig
The `Kconfig.defconfig` file is where overrides for various configuration settings
@@ -63,12 +77,41 @@ config ZMK_KEYBOARD_NAME
endif
```
-## Shield Overlay
+
+Similarly to defining the halves of a split board in `Kconfig.shield` it is important to set the `ZMK_KEYBOARD_NAME` for each half of a split keyboard.
+
+```
+if SHIELD_MY_BOARD_LEFT
+
+config ZMK_KEYBOARD_NAME
+ default "My Awesome Keyboard Left"
+
+endif
+
+if SHIELD_MY_BOARD_RIGHT
+
+config ZMK_KEYBOARD_NAME
+ default "My Awesome Keyboard Right"
+
+endif
+```
+
+## Shield Overlays
![Labelled Pro Micro pins](assets/pro-micro/pro-micro-pins-labelled.jpg)
+
ZMK uses the green color coded pin names to generate devicetree node references. For example, to refer to the node `D0` in the devicetree files, use `&pro_micro_d 0` or to refer to `A1`, use `&pro_micro_a 1`.
+<Tabs
+defaultValue="unibody"
+values={[
+{label: 'Unibody Shields', value: 'unibody'},
+{label: 'Split Shields', value: 'split'},
+]}>
+
+<TabItem value="unibody">
+
The `<shield_name>.overlay` is the devicetree description of the keyboard shield that is merged with the primary board devicetree description before the build. For ZMK, this file at a minimum should include the [chosen]() node named `zmk,kscan` that references a KSCAN driver instance. For a simple 3x3 macropad matrix,
this might look something like:
@@ -98,6 +141,146 @@ this might look something like:
};
```
+</TabItem>
+
+<TabItem value="split">
+
+### .dtsi files and Shield Overlays (Split Shields)
+
+Unlike unibody keyboards, split keyboards have a core .dtsi file with shield overlays for each half of the keyboard.
+It is preferred to define only the `col-gpios` or `row-gpios` in the common shield .dtsi, depending on the `diode-direction` value.
+For `col2row` directed boards like the iris, the shared .dtsi file may look like this:
+
+```
+#include <dt-bindings/zmk/matrix-transform.h>
+
+/ {
+ chosen {
+ zmk,kscan = &kscan0;
+ zmk,matrix_transform = &default_transform;
+ };
+
+ default_transform: keymap_transform_0 {
+ compatible = "zmk,matrix-transform";
+ columns = <16>;
+ rows = <4>;
+// | SW6 | SW5 | SW4 | SW3 | SW2 | SW1 | | SW1 | SW2 | SW3 | SW4 | SW5 | SW6 |
+// | SW12 | SW11 | SW10 | SW9 | SW8 | SW7 | | SW7 | SW8 | SW9 | SW10 | SW11 | SW12 |
+// | SW18 | SW17 | SW16 | SW15 | SW14 | SW13 | | SW13 | SW14 | SW15 | SW16 | SW17 | SW18 |
+// | SW24 | SW23 | SW22 | SW21 | SW20 | SW19 | SW25 | | SW25 | SW19 | SW20 | SW21 | SW22 | SW23 | SW24 |
+// | SW29 | SW28 | SW27 | SW26 | | SW26 | SW27 | SW28 | SW29 |
+ map = <
+RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) RC(0,10) RC(0,11)
+RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11)
+RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11)
+RC(3,0) RC(3,1) RC(3,2) RC(3,3) RC(3,4) RC(3,5) RC(4,2) RC(4,9) RC(3,6) RC(3,7) RC(3,8) RC(3,9) RC(3,10) RC(3,11)
+ RC(4,3) RC(4,4) RC(4,5) RC(4,6) RC(4,7) RC(4,8)
+ >;
+ };
+
+ kscan0: kscan {
+ compatible = "zmk,kscan-gpio-matrix";
+ label = "KSCAN";
+
+ diode-direction = "col2row";
+ row-gpios
+ = <&pro_micro_d 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row A from the schematic file
+ , <&pro_micro_d 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row B from the schematic file
+ , <&pro_micro_d 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row C from the schematic file
+ , <&pro_micro_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row D from the schematic file
+ , <&pro_micro_d 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> // Row E from the schematic file
+ ;
+
+ };
+```
+
+:::note
+Notice that in addition to the common `row-gpios` that are declared in the kscan, the [matrix transform](#optional-matrix-transform) is defined in the .dtsi.
+:::
+
+The missing `col-gpios` would be defined in your `<boardname>_left.overlay` and `<boardname>_right.overlay` files.
+Keep in mind that the mirrored position of the GPIOs means that the `col-gpios` will appear reversed when the .overlay files are compared to one another.
+Furthermore, the column offset for the [matrix transform](#optional-matrix-transform) should be added to the right half of the keyboard's overlay
+because the keyboard's switch matrix is read from left to right, top to bottom.
+This is exemplified with the iris .overlay files.
+
+```
+// iris_left.overlay
+
+#include "iris.dtsi" // Notice that the main dtsi files are included in the overlay.
+
+&kscan0 {
+ col-gpios
+ = <&pro_micro_a 1 GPIO_ACTIVE_HIGH> // col1 in the schematic
+ , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> // col2 in the schematic
+ , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> // col3 in the schematic
+ , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> // col4 in the schematic
+ , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> // col5 in the schematic
+ , <&pro_micro_d 10 GPIO_ACTIVE_HIGH> // col6 in the schematic
+ ;
+};
+```
+
+```
+// iris_right.overlay
+
+#include "iris.dtsi"
+
+&default_transform { // The matrix transform for this board is 6 columns over because the left half is 6 columns wide according to the matrix.
+ col-offset = <6>;
+};
+
+&kscan0 {
+ col-gpios
+ = <&pro_micro_d 10 GPIO_ACTIVE_HIGH> // col6 in the schematic
+ , <&pro_micro_d 16 GPIO_ACTIVE_HIGH> // col5 in the schematic
+ , <&pro_micro_d 14 GPIO_ACTIVE_HIGH> // col4 in the schematic
+ , <&pro_micro_d 15 GPIO_ACTIVE_HIGH> // col3 in the schematic
+ , <&pro_micro_a 0 GPIO_ACTIVE_HIGH> // col2 in the schematic
+ , <&pro_micro_a 1 GPIO_ACTIVE_HIGH> // col1 in the schematic
+ ;
+};
+
+```
+
+### .conf files (Split Shields)
+
+While unibody boards only have one .conf file that applies configuration characteristics to the entire keyboard,
+split keyboards are unique in that they contain multiple .conf files with different scopes.
+For example, a split board called `my_awesome_split_board` would have the following files:
+
+* `my_awesome_split_board.conf` - Configuration elements affect both halves
+* `my_awesome_split_board_left.conf` - Configuration elements only affect left half
+* `my_awesome_split_board_right.conf` - Configuration elements only affect right half
+
+For proper communication between keyboard halves and that between the central half and the computer,
+the **the central and peripheral halves of the keyboard must be defined**. This can be seen below.
+
+```
+// Central Half (Usually the left side: my_awesome_split_board_left.conf)
+
+CONFIG_ZMK_SPLIT=y
+CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL=y
+```
+
+```
+// Peripheral Half (Usually the right side: my_awesome_split_board_right.conf)
+
+CONFIG_ZMK_SPLIT=y
+CONFIG_ZMK_SPLIT_BLE_ROLE_Peripheral=y
+```
+
+Using the .conf file that affects both halves of a split board would be for adding features like deep-sleep or rotary encoders.
+
+```
+// my_awesome_split_board.conf
+
+CONFIG_ZMK_SLEEP=y
+```
+
+</TabItem>
+</Tabs>
+
## (Optional) Matrix Transform
Internally ZMK translates all row/column events into "key position" events to maintain a consistent model that works no matter what any possible GPIO matrix may look like for a certain keyboard. This is particularly helpful when:
@@ -238,6 +421,7 @@ If building locally for split boards, you may need to add these lines to the spe
<TabItem value = "dtsi">
In your device tree file you will need to add the following lines to define the encoder sensor:
+
```
left_encoder: encoder_left {
compatible = "alps,ec11";
@@ -247,7 +431,6 @@ left_encoder: encoder_left {
resolution = <4>;
};
```
-
Here you will have to replace PIN_A and PIN_B with the appropriate pins that your PCB utilizes for the encoder(s). For keyboards that use the Pro Micro or any of the Pro Micro replacements, Sparkfun's [Pro Micro Hookup Guide](https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide/hardware-overview-pro-micro) has a pinout diagram that can be useful to determine the right pins. Reference either the blue numbers labeled "Arduino" (digital pins) or the green numbers labeled "Analog" (analog pins). For pins that are labeled as both digital and analog, refer to your specific board's .dtsi file to determine how you should refer to that pin.
Add additional encoders as necessary by duplicating the above lines, replacing `left` with whatever you would like to call your encoder, and updating the pins. Note that support for peripheral (right) side sensors over BLE is still in progress.
@@ -279,15 +462,12 @@ For split keyboards, make sure to add left hand encoders to the left .overlay fi
</TabItem>
<TabItem value = "keymap">
-Add the following line to each layer of your keymap file to add default encoder behavior bindings:
+Add the following line to your keymap file to add default encoder behavior bindings:
```
sensor-bindings = <&inc_dec_cp M_VOLU M_VOLD>;
```
-
-This should be placed after the regular key bindings but within the layer (see the [Default Keymap section](/docs/dev-guide-new-shield#default-keymap) above for an example of where).
-
-Add additional bindings as necessary to match the default number of encoders on your board. Details on the syntax can be found in the [Encoders](/docs/feature/encoders) and [Keymap](/docs/feature/keymaps) feature documentation.
+Add additional bindings as necessary to match the default number of encoders on your board. See the [Encoders](/docs/feature/encoders) and [Keymap](/docs/feature/keymaps) feature documentation for more details.
</TabItem>
</Tabs>
@@ -307,6 +487,11 @@ and then flash with:
west flash
```
+:::note
+Further testing your keyboard shield without altering the root keymap file can be done with the use of `-DZMK_CONFIG` in your `west build` command,
+shown [here](dev-build-flash#building-from-zmk-config-folder)
+:::
+
## Updating `build.yml`
Before publishing your shield to the public via a PR, navigate to `build.yml` found in `.github/workflows` and add your shield to the appropriate list. An example edit to `build.yml` is shown below.
@@ -336,7 +521,6 @@ jobs:
- board: proton_c
shield: clueboard_california
```
-
:::note
Notice that both the left and right halves of a split board need to be added to the list of shields for proper error checking.
:::note
diff --git a/docs/docs/dev-setup.md b/docs/docs/dev-setup.md
index 4891f5a..521d5d0 100644
--- a/docs/docs/dev-setup.md
+++ b/docs/docs/dev-setup.md
@@ -16,6 +16,7 @@ values={[
{label: 'macOS', value: 'mac'},
{label: 'Raspberry OS', value: 'raspberryos'},
{label: 'Fedora', value: 'fedora'},
+{label: 'VS Code & Docker', value: 'docker'},
]
}>{props.children}</Tabs>);
@@ -167,6 +168,10 @@ Chocolatey is recommended and used for the following instructions. You can manua
choco install ninja gperf python git
```
+It is recommended to install `dfu-util` to avoid any later confusion while flashing devices. You can do this by running this command with chocolatey:
+``` shell
+choco install dfu-util
+```
</TabItem>
<TabItem value="mac">
@@ -175,10 +180,24 @@ Chocolatey is recommended and used for the following instructions. You can manua
Homebrew is required to install the system dependencies. If you haven't done so, visit [Homebrew](https://brew.sh/) for instructions. Once installed, use it to install the base dependencies:
```
-brew install cmake ninja python3 ccache dtc git wget
+brew install cmake ninja python3 ccache dtc git wget dfu-util
```
</TabItem>
+<TabItem value="docker">
+
+This setup leverages the same [image which is used by the GitHub action](https://github.com/zmkfirmware/zephyr-west-action) for local development. Beyond the benefits of [dev/prod parity](https://12factor.net/dev-prod-parity), this approach is also the easiest to set up. No toolchain or dependencies are necessary when using Docker; the container image you'll be using already has the toolchain installed and set up to use.
+
+
+1. Install [Docker Desktop](https://www.docker.com/products/docker-desktop) for your operating system.
+2. Install [VS Code](https://code.visualstudio.com/)
+3. Install the [Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
+
+:::info
+The docker container includes `west` and the compilation toolchain. If you're using docker and VS Code, you can skip right to [Source Code](#source-code).
+:::
+
+</TabItem>
</OsTabs>
## Setup
@@ -349,12 +368,63 @@ Since ZMK is built as a Zephyr™ application, the next step is
to use `west` to initialize and update your workspace. The ZMK
Zephyr™ application is in the `app/` source directory:
+
#### Step into the repository
+<OsTabs>
+<TabItem value="debian">
+
+```sh
+cd zmk
+```
+
+</TabItem>
+<TabItem value="raspberryos">
+
+```sh
+cd zmk
+```
+
+</TabItem>
+<TabItem value="fedora">
+
+```sh
+cd zmk
+```
+
+</TabItem>
+<TabItem value="mac">
+
```sh
cd zmk
```
+</TabItem>
+<TabItem value="win">
+
+```sh
+cd zmk
+```
+
+</TabItem>
+
+<TabItem value="docker">
+
+Open the `zmk` checkout folder in VS Code. The repository includes a configuration for containerized development, so an alert will pop up:
+
+![VS Code Dev Container Configuration Alert](assets/dev-setup/vscode_devcontainer.png)
+
+Click `Reopen in Container` in order to reopen the VS Code with the running container.
+
+The first time you do this on your machine, it will pull the docker image down from the registry and build the container. Subsequent launches are much faster!
+
+:::caution
+All subsequent steps must be performed from the VS Code terminal _inside_ the container.
+:::
+
+</TabItem>
+</OsTabs>
+
#### Initialize West
```sh
@@ -373,6 +443,17 @@ section again for links to how to do this
west update
```
+:::tip
+This step pulls down quite a bit of tooling. Go grab a cup of coffee, it can take 10-15 minutes even on a good internet connection!
+:::
+
+:::info
+If you're using Docker, you're done with setup! You must restart the container at this point. The easiest way to do so is to close the VS Code window, verify that the container has stopped in Docker Dashboard, and reopen the container with VS Code.
+
+Once your container is restarted, proceed to [Building and Flashing](./dev-build.md).
+:::
+
+
#### Export Zephyr™ Core
```sh
diff --git a/docs/docs/hardware.md b/docs/docs/hardware.md
index faac57c..fe229df 100644
--- a/docs/docs/hardware.md
+++ b/docs/docs/hardware.md
@@ -29,7 +29,7 @@ That being said, there are currently only a few specific [boards](/docs/faq#what
- [Sofle](https://github.com/josefadamcik/SofleKeyboard) (`sofle_left` and `sofle_right`)
- [Splitreus62](https://github.com/Na-Cly/splitreus62) (`splitreus62_left` and `splitreus62_right`)
- [RoMac+ v4](https://www.littlekeyboards.com/products/romac) (`romac_plus`)
-- [RoMac v2](https://mechboards.co.uk/shop/kits/romac-macro-pad/) (`romac')
+- [RoMac v2](https://mechboards.co.uk/shop/kits/romac-macro-pad/) (`romac`)
- [QAZ](https://www.cbkbd.com/product/qaz-keyboard-kit) (`qaz`)
## Other Hardware
diff --git a/docs/docs/user-setup.md b/docs/docs/user-setup.md
index 2aade82..2785096 100644
--- a/docs/docs/user-setup.md
+++ b/docs/docs/user-setup.md
@@ -63,6 +63,7 @@ defaultValue="curl"
values={[
{label: 'Using curl', value: 'curl'},
{label: 'Using wget', value: 'wget'},
+{label: 'Using PowerShell', value: 'PowerShell'},
]}>
<TabItem value="curl">
@@ -78,6 +79,12 @@ bash -c "$(wget https://zmkfirmware.dev/setup.sh -O -)"
```
</TabItem>
+<TabItem value="PowerShell">
+
+```
+iex ((New-Object System.Net.WebClient).DownloadString('https://zmkfirmware.dev/setup.ps1'))"
+```
+</TabItem>
</Tabs>
### MCU Board Selection
diff --git a/docs/sidebars.js b/docs/sidebars.js
index 93ce226..12b4a6e 100644
--- a/docs/sidebars.js
+++ b/docs/sidebars.js
@@ -23,6 +23,7 @@ module.exports = {
"behavior/reset",
"behavior/bluetooth",
"behavior/lighting",
+ "behavior/power",
],
Development: [
"dev-clean-room",
diff --git a/docs/static/setup.ps1 b/docs/static/setup.ps1
index abdb698..5ebd376 100644
--- a/docs/static/setup.ps1
+++ b/docs/static/setup.ps1
@@ -57,7 +57,20 @@ catch [System.Management.Automation.CommandNotFoundException] {
}
Test-Git-Config -Option "user.name" -ErrMsg "Git username not set!`nRun: git config --global user.name 'My Name'"
-Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.name 'example@myemail.com'"
+Test-Git-Config -Option "user.email" -ErrMsg "Git email not set!`nRun: git config --global user.email 'example@myemail.com'"
+
+$permission = (Get-Acl $pwd).Access |
+?{$_.IdentityReference -match $env:UserName `
+ -and $_.FileSystemRights -match "FullControl" `
+ -or $_.FileSystemRights -match "Write" } |
+
+ Select IdentityReference,FileSystemRights
+
+If (-Not $permission){
+ Write-Host "Sorry, you do not have write permissions in this directory."
+ Write-Host "Please try running this script again from a directory that you do have write permissions for."
+ exit 1
+}
$repo_path = "https://github.com/zmkfirmware/zmk-config-split-template.git"
@@ -78,9 +91,9 @@ Write-Host "Keyboard Shield Selection:"
$prompt = "Pick a keyboard"
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
-$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "makerdiary M60", "Microdox"
-$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "m60", "microdox"
-$splits = "y", "y", "y", "y", "y", "y", "n", "n", "y"
+$options = "Kyria", "Lily58", "Corne", "Splitreus62", "Sofle", "Iris", "RoMac", "RoMac+", "makerdiary M60", "Microdox", "TG4X", "QAZ"
+$names = "kyria", "lily58", "corne", "splitreus62", "sofle", "iris", "romac", "romac_plus", "m60", "microdox", "tg4x", "qaz"
+$splits = "y", "y", "y", "y", "y", "y", "n", "n", "n", "y", "n", "n"
$choice = Get-Choice-From-Options -Options $options -Prompt $prompt
$shield_title = $($options[$choice])
diff --git a/docs/static/setup.sh b/docs/static/setup.sh
index 49ed3eb..e45a7ed 100644
--- a/docs/static/setup.sh
+++ b/docs/static/setup.sh
@@ -22,6 +22,13 @@ check_exists "command -v curl" "curl is not installed, and is required for this
check_exists "git config user.name" "Git username not set!\nRun: git config --global user.name 'My Name'"
check_exists "git config user.email" "Git email not set!\nRun: git config --global user.email 'example@myemail.com'"
+# Check to see if the user has write permissions in this directory to prevent a cryptic error later on
+if [ ! -w `pwd` ]; then
+ echo 'Sorry, you do not have write permissions in this directory.';
+ echo 'Please try running this script again from a directory that you do have write permissions for.';
+ exit 1
+fi
+
repo_path="https://github.com/zmkfirmware/zmk-config-split-template.git"
title="ZMK Config Setup:"
@@ -51,7 +58,7 @@ echo ""
echo "Keyboard Shield Selection:"
prompt="Pick an keyboard:"
-options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "makerdiary M60" "Microdox")
+options=("Kyria" "Lily58" "Corne" "Splitreus62" "Sofle" "Iris" "RoMac" "RoMac+" "makerdiary M60" "Microdox" "TG4X" "QAZ")
PS3="$prompt "
# TODO: Add support for "Other" and linking to docs on adding custom shields in user config repos.
@@ -67,8 +74,11 @@ select opt in "${options[@]}" "Quit"; do
5 ) shield_title="Sofle" shield="sofle"; split="y"; break;;
6 ) shield_title="Iris" shield="iris"; split="y"; break;;
7 ) shield_title="RoMac" shield="romac"; split="n"; break;;
- 8 ) shield_title="M60" shield="m60"; split="n"; break;;
- 9 ) shield_title="Microdox" shield="microdox"; split="y"; break;;
+ 8 ) shield_title="RoMac+" shield="romac_plus"; split="n"; break;;
+ 9 ) shield_title="M60" shield="m60"; split="n"; break;;
+ 10 ) shield_title="Microdox" shield="microdox"; split="y"; break;;
+ 11 ) shield_title="TG4X" shield="tg4x"; split="n"; break;;
+ 12 ) shield_title="QAZ" shield="qaz"; split="n"; break;;
# Add link to docs on adding your own custom shield in your ZMK config!
# $(( ${#options[@]}+1 )) ) echo "Other!"; break;;