initial commit

This commit is contained in:
Rudis Muiznieks 2022-03-01 19:38:13 -06:00
commit 8c285eb6e5
Signed by: rudism
GPG key ID: CABF2F86EF7884F9
7 changed files with 113 additions and 0 deletions

36
build-env/Dockerfile Normal file
View file

@ -0,0 +1,36 @@
from ubuntu:20.04
run apt update
run DEBIAN_FRONTEND=noninteractive TZ=America/Chicago apt install -y \
git \
wget \
autoconf \
automake \
build-essential \
bzip2 \
ccache \
device-tree-compiler \
dfu-util \
g++ \
gcc \
libtool \
make \
ninja-build \
cmake \
python3-dev \
python3-pip \
python3-setuptools \
xz-utils
run useradd -m rudism
user rudism
workdir /home/rudism
run pip3 install --user -U west
run echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc
env ZSDK_VERSION=0.12.4
run wget -q "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${ZSDK_VERSION}/zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run" && \
sh "zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run" --quiet -- -d ~/.local/zephyr-sdk-${ZSDK_VERSION} && \
rm "zephyr-toolchain-arm-${ZSDK_VERSION}-x86_64-linux-setup.run"
copy requirements.txt .
run pip3 install --user -r requirements.txt
run echo source zmk/zephyr/zephyr-env.sh >> ~/.bashrc
entrypoint bash

7
build-env/build Executable file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env bash
cd /home/rudism/zmk/app || exit
west build --pristine -b nice_nano_v2 -- -DZMK_CONFIG=/home/rudism/zmk-config/config -DSHIELD=corne_left
cp /home/rudism/zmk/app/build/zephyr/zmk.uf2 /home/rudism/out/corne_left.uf2
west build --pristine -b nice_nano_v2 -- -DZMK_CONFIG=/home/rudism/zmk-config/config -DSHIELD=corne_right
cp /home/rudism/zmk/app/build/zephyr/zmk.uf2 /home/rudism/out/corne_right.uf2

17
build-env/flash Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
set -e
DEVICE=$1
SIDE=$2
if [ "$SIDE" != "left" ] && [ "$SIDE" != "right" ]; then
echo "Usage: ./flash device side"
echo " eg: ./flash /dev/sdb right"
exit 1
fi
sudo mount "$DEVICE" /mnt/usb
sudo cp "out/corne_$SIDE.uf2" /mnt/usb
sudo sync
sudo umount /mnt/usb

3
build-env/run Executable file
View file

@ -0,0 +1,3 @@
#!/bin/sh
docker run -it --rm -v `pwd`/build:/home/rudism/build -v `pwd`/out:/home/rudism/out -v `pwd`/zmk:/home/rudism/zmk -v `pwd`/zmk-config:/home/rudism/zmk-config zmk

1
config/corne.conf Normal file
View file

@ -0,0 +1 @@
CONFIG_ZMK_MOUSE=y

38
config/corne.keymap Normal file
View file

@ -0,0 +1,38 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/mouse.h>
/ {
keymap {
compatible = "zmk,keymap";
default_layer {
bindings = <
&kp TAB &kp SQT &kp COMMA &kp DOT &kp P &kp Y &kp F &kp G &kp C &kp R &kp L &kp BSPC
&kp ESC &kp A &kp O &kp E &kp U &kp I &kp D &kp H &kp T &kp N &kp S &kp MINUS
&kp LCTRL &kp SEMI &kp Q &kp J &kp K &kp X &kp B &kp M &kp W &kp V &kp Z &kp LALT
&kp LSHFT &kp LGUI &lt 2 RET &lt 1 SPACE &kp RGUI &kp RSHFT
>;
};
layer_raise {
bindings = <
&trans &trans &trans &trans &kp LBKT &kp RBKT &kp BSLH &kp FSLH &kp GRAVE &kp EQUAL &kp DEL &trans
&trans &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &trans
&trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp LCTRL
&trans &trans &trans &trans &trans &trans
>;
};
layer_lower {
bindings = <
&trans &none &kp PSCRN &kp UP &mkp LCLK &mkp RCLK &kp RET &kp SPACE &kp PG_UP &kp INS &kp K_VOL_UP &trans
&trans &kp K_BACK &kp LEFT &kp DOWN &kp RIGHT &kp SLCK &trans &kp HOME &kp PG_DN &kp END &kp K_PLAY_PAUSE &trans
&kp LALT &kp K_FORWARD &trans &trans &trans &mkp MCLK &kp F11 &kp F12 &trans &kp K_MUTE &kp K_VOL_DN &trans
&trans &trans &trans &trans &trans &trans
>;
};
};
};

11
config/west.yml Normal file
View file

@ -0,0 +1,11 @@
manifest:
remotes:
- name: zmkfirmware
url-base: https://github.com/zmkfirmware
projects:
- name: zmk
remote: zmkfirmware
revision: main
import: app/west.yml
self:
path: config