mirror of
https://github.com/tcaxle/zmk-config.git
synced 2026-04-01 06:31:36 +01:00
Compare commits
77 Commits
switch-tes
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6aa700fb8f | ||
| 963df5b591 | |||
|
|
255b8f6289 | ||
| 8a0742db47 | |||
| 6194264338 | |||
| 923bed2bcb | |||
|
|
982de6524f | ||
|
|
34b20dbf4e | ||
|
|
78be1617ae | ||
|
|
5ae72e2446 | ||
|
|
9104e9a3d3 | ||
|
|
8a1088f5c5 | ||
| 9c0b22adb3 | |||
| 1a841e047d | |||
| acf2e921a7 | |||
| c3696d422b | |||
|
|
fdc28d1f25 | ||
|
|
cec351d770 | ||
|
|
38097c6533 | ||
|
|
97bcd345df | ||
|
|
c345d29be4 | ||
|
|
9e454ac5bc | ||
|
|
6bad1cb89e | ||
|
|
d9b07dc8a8 | ||
|
|
90c754a4d0 | ||
|
|
fe6c74e467 | ||
|
|
1f035c9de6 | ||
|
|
f6f50d3ca4 | ||
|
|
cd055d37c4 | ||
|
|
07d7b7389d | ||
|
|
7713b7b3b9 | ||
|
|
ec43527c57 | ||
|
|
7c42f06d84 | ||
|
|
4ca6a928f1 | ||
|
|
cc8472a410 | ||
|
|
b079c93e6e | ||
|
|
def6ae098f | ||
|
|
f4cf36b813 | ||
|
|
e002d078a4 | ||
|
|
20d6aaa181 | ||
|
|
17d7bb8dee | ||
|
|
7a8d53ba81 | ||
|
|
434d911325 | ||
|
|
8b06af7c5e | ||
|
|
eb810dcc25 | ||
|
|
c0e0aba09e | ||
|
|
153b2d4a49 | ||
|
|
e6a42040da | ||
|
|
dbf7acc12d | ||
|
|
10ee645a5d | ||
|
|
acc1716ef5 | ||
|
|
94430f6eb5 | ||
|
|
48a3fdeca2 | ||
|
|
371ba69fab | ||
|
|
e45bc40f51 | ||
|
|
8dbdc3345d | ||
|
|
7f9e0329dc | ||
|
|
82924ffe77 | ||
|
|
ef7cebcdcc | ||
|
|
38e8f34f1c | ||
|
|
8e6e907148 | ||
|
|
a303d3c1f5 | ||
|
|
b7eb25ac72 | ||
|
|
7803939878 | ||
|
|
f268bf3339 | ||
|
|
4805af0535 | ||
|
|
44bf02c174 | ||
|
|
931eadbd5c | ||
|
|
bb503d5ce2 | ||
|
|
ca7c039b3e | ||
|
|
09b308e4e2 | ||
|
|
98dd558521 | ||
|
|
1615d83b70 | ||
|
|
a6e420a203 | ||
|
|
1d26193f8e | ||
|
|
4578ea8820 | ||
|
|
3bf00d060c |
411
.gitea/workflows/build.yml
Normal file
411
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,411 @@
|
|||||||
|
name: Build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- ".gitea/workflows/build.yml"
|
||||||
|
- "app/**"
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- ".gitea/workflows/build.yml"
|
||||||
|
- "app/**"
|
||||||
|
schedule:
|
||||||
|
- cron: "22 4 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
if: ${{ always() }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: docker.io/zmkfirmware/zmk-build-arm:3.2
|
||||||
|
needs: compile-matrix
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include: ${{ fromJSON(needs.compile-matrix.outputs.include-list) }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Cache west modules
|
||||||
|
uses: actions/cache@v3.0.2
|
||||||
|
env:
|
||||||
|
cache-name: cache-zephyr-modules
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
modules/
|
||||||
|
tools/
|
||||||
|
zephyr/
|
||||||
|
bootloader/
|
||||||
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('app/west.yml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||||
|
${{ runner.os }}-build-
|
||||||
|
${{ runner.os }}-
|
||||||
|
timeout-minutes: 2
|
||||||
|
continue-on-error: true
|
||||||
|
- name: Initialize workspace (west init)
|
||||||
|
run: west init -l app
|
||||||
|
- name: Update modules (west update)
|
||||||
|
run: west update
|
||||||
|
- name: Export Zephyr CMake package (west zephyr-export)
|
||||||
|
run: west zephyr-export
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "14.x"
|
||||||
|
- name: Install @actions/artifact
|
||||||
|
run: npm install @actions/artifact
|
||||||
|
- name: Build and upload artifacts
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
id: boards-list
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const artifact = require('@actions/artifact');
|
||||||
|
const artifactClient = artifact.create();
|
||||||
|
|
||||||
|
const execSync = require('child_process').execSync;
|
||||||
|
|
||||||
|
const buildShieldArgs = JSON.parse(`${{ matrix.shieldArgs }}`);
|
||||||
|
|
||||||
|
let error = false;
|
||||||
|
|
||||||
|
for (const shieldArgs of buildShieldArgs) {
|
||||||
|
try {
|
||||||
|
const output = execSync(`west build -s app -p -b ${{ matrix.board }} -- ${shieldArgs.shield ? '-DSHIELD="' + shieldArgs.shield + '"' : ''} ${shieldArgs['cmake-args'] || ''}`);
|
||||||
|
|
||||||
|
console.log(`::group::${{ matrix.board}} ${shieldArgs.shield} Build`)
|
||||||
|
console.log(output.toString());
|
||||||
|
|
||||||
|
const fileExtensions = ["hex", "uf2"];
|
||||||
|
|
||||||
|
const files = fileExtensions
|
||||||
|
.map(extension => "build/zephyr/zmk." + extension)
|
||||||
|
.filter(path => fs.existsSync(path));
|
||||||
|
|
||||||
|
const rootDirectory = 'build/zephyr';
|
||||||
|
const options = {
|
||||||
|
continueOnError: true
|
||||||
|
}
|
||||||
|
|
||||||
|
const cmakeName = shieldArgs['cmake-args'] ? '-' + (shieldArgs.nickname || shieldArgs['cmake-args'].split(' ').join('')) : '';
|
||||||
|
const artifactName = `${{ matrix.board }}${shieldArgs.shield ? '-' + shieldArgs.shield : ''}${cmakeName}-zmk`;
|
||||||
|
|
||||||
|
await artifactClient.uploadArtifact(artifactName, files, rootDirectory, options);
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`::error::Failed to build or upload ${{ matrix.board }} ${shieldArgs.shield} ${shieldArgs['cmake-args']}`);
|
||||||
|
console.error(e);
|
||||||
|
error = true;
|
||||||
|
} finally {
|
||||||
|
console.log('::endgroup::');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (error) {
|
||||||
|
throw new Error('Failed to build one or more configurations');
|
||||||
|
}
|
||||||
|
compile-matrix:
|
||||||
|
if: ${{ always() }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [core-coverage, board-changes, nightly]
|
||||||
|
outputs:
|
||||||
|
include-list: ${{ steps.compile-list.outputs.result }}
|
||||||
|
steps:
|
||||||
|
- name: Join build lists
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
id: compile-list
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const coreCoverage = `${{ needs.core-coverage.outputs.core-include }}` || "[]";
|
||||||
|
const boardChanges = `${{ needs.board-changes.outputs.boards-include }}` || "[]";
|
||||||
|
const nightly = `${{ needs.nightly.outputs.nightly-include }}` || "[]";
|
||||||
|
|
||||||
|
const combined = [
|
||||||
|
...JSON.parse(coreCoverage),
|
||||||
|
...JSON.parse(boardChanges),
|
||||||
|
...JSON.parse(nightly)
|
||||||
|
];
|
||||||
|
const combinedUnique = [...new Map(combined.map(el => [JSON.stringify(el), el])).values()];
|
||||||
|
|
||||||
|
const perBoard = {};
|
||||||
|
|
||||||
|
for (const configuration of combinedUnique) {
|
||||||
|
if (!perBoard[configuration.board])
|
||||||
|
perBoard[configuration.board] = [];
|
||||||
|
|
||||||
|
perBoard[configuration.board].push({
|
||||||
|
shield: configuration.shield,
|
||||||
|
'cmake-args': configuration['cmake-args'],
|
||||||
|
nickname: configuration.nickname
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
return Object.entries(perBoard).map(([board, shieldArgs]) => ({
|
||||||
|
board,
|
||||||
|
shieldArgs: JSON.stringify(shieldArgs),
|
||||||
|
}));
|
||||||
|
core-coverage:
|
||||||
|
if: ${{ needs.get-changed-files.outputs.core-changes == 'true' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: get-changed-files
|
||||||
|
outputs:
|
||||||
|
core-include: ${{ steps.core-list.outputs.result }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "14.x"
|
||||||
|
- name: Install js-yaml
|
||||||
|
run: npm install js-yaml
|
||||||
|
- uses: actions/github-script@v4
|
||||||
|
id: core-list
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const coreCoverage = yaml.load(fs.readFileSync('app/core-coverage.yml', 'utf8'));
|
||||||
|
|
||||||
|
let include = coreCoverage.board.flatMap(board =>
|
||||||
|
coreCoverage.shield.map(shield => ({ board, shield }))
|
||||||
|
);
|
||||||
|
|
||||||
|
return [...include, ...coreCoverage.include];
|
||||||
|
board-changes:
|
||||||
|
if: ${{ needs.get-changed-files.outputs.board-changes == 'true' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [get-grouped-hardware, get-changed-files]
|
||||||
|
outputs:
|
||||||
|
boards-include: ${{ steps.boards-list.outputs.result }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "14.x"
|
||||||
|
- name: Install js-yaml
|
||||||
|
run: npm install js-yaml
|
||||||
|
- uses: actions/github-script@v4
|
||||||
|
id: boards-list
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const changedFiles = JSON.parse(`${{ needs.get-changed-files.outputs.changed-files }}`);
|
||||||
|
const metadata = JSON.parse(`${{ needs.get-grouped-hardware.outputs.organized-metadata }}`);
|
||||||
|
const boardChanges = new Set(changedFiles.filter(f => f.startsWith('app/boards')).map(f => f.split('/').slice(0, 4).join('/')));
|
||||||
|
|
||||||
|
return (await Promise.all([...boardChanges].flatMap(async bc => {
|
||||||
|
const globber = await glob.create(bc + "/*.zmk.yml");
|
||||||
|
const files = await globber.glob();
|
||||||
|
|
||||||
|
const aggregated = files.flatMap((f) =>
|
||||||
|
yaml.loadAll(fs.readFileSync(f, "utf8"))
|
||||||
|
);
|
||||||
|
|
||||||
|
const boardAndShield = (b, s) => {
|
||||||
|
if (s.siblings) {
|
||||||
|
return s.siblings.map(shield => ({
|
||||||
|
board: b.id,
|
||||||
|
shield,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
board: b.id,
|
||||||
|
shield: s.id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return aggregated.flatMap(hm => {
|
||||||
|
switch (hm.type) {
|
||||||
|
case "board":
|
||||||
|
if (hm.features && hm.features.includes("keys")) {
|
||||||
|
if (hm.siblings) {
|
||||||
|
return hm.siblings.map(board => ({
|
||||||
|
board,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
board: hm.id
|
||||||
|
};
|
||||||
|
}
|
||||||
|
} else if (hm.exposes) {
|
||||||
|
return hm.exposes.flatMap(i =>
|
||||||
|
metadata.interconnects[i].shields.flatMap(s => boardAndShield(hm, s))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.error("Board without keys or interconnect");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "shield":
|
||||||
|
if (hm.features && hm.features.includes("keys")) {
|
||||||
|
return hm.requires.flatMap(i =>
|
||||||
|
metadata.interconnects[i].boards.flatMap(b => boardAndShield(b, hm))
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.warn("Unhandled shield without keys");
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "interconnect":
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}))).flat();
|
||||||
|
nightly:
|
||||||
|
if: ${{ github.event_name == 'schedule' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: get-grouped-hardware
|
||||||
|
outputs:
|
||||||
|
nightly-include: ${{ steps.nightly-list.outputs.result }}
|
||||||
|
steps:
|
||||||
|
- name: Create nightly list
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
id: nightly-list
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const metadata = JSON.parse(`${{ needs.get-grouped-hardware.outputs.organized-metadata }}`);
|
||||||
|
|
||||||
|
let includeOnboard = metadata.onboard.flatMap(b => {
|
||||||
|
if (b.siblings) {
|
||||||
|
return b.siblings.map(board => ({
|
||||||
|
board,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
board: b.id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let includeInterconnect = Object.values(metadata.interconnects).flatMap(i =>
|
||||||
|
i.boards.flatMap(b =>
|
||||||
|
i.shields.flatMap(s => {
|
||||||
|
if (s.siblings) {
|
||||||
|
return s.siblings.map(shield => ({
|
||||||
|
board: b.id,
|
||||||
|
shield,
|
||||||
|
}));
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
board: b.id,
|
||||||
|
shield: s.id,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return [...includeOnboard, ...includeInterconnect];
|
||||||
|
get-grouped-hardware:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
organized-metadata: ${{ steps.organize-metadata.outputs.result }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "14.x"
|
||||||
|
- name: Install js-yaml
|
||||||
|
run: npm install js-yaml
|
||||||
|
- name: Aggregate Metadata
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
id: aggregate-metadata
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const fs = require('fs');
|
||||||
|
const yaml = require('js-yaml');
|
||||||
|
|
||||||
|
const globber = await glob.create("app/boards/**/*.zmk.yml");
|
||||||
|
const files = await globber.glob();
|
||||||
|
|
||||||
|
const aggregated = files.flatMap((f) =>
|
||||||
|
yaml.loadAll(fs.readFileSync(f, "utf8"))
|
||||||
|
);
|
||||||
|
|
||||||
|
return JSON.stringify(aggregated).replace(/\\/g,"\\\\").replace(/`/g,"\\`");
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
|
- name: Organize Metadata
|
||||||
|
uses: actions/github-script@v4
|
||||||
|
id: organize-metadata
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const hardware = JSON.parse(`${{ steps.aggregate-metadata.outputs.result }}`);
|
||||||
|
|
||||||
|
const grouped = hardware.reduce((agg, hm) => {
|
||||||
|
switch (hm.type) {
|
||||||
|
case "board":
|
||||||
|
if (hm.features && hm.features.includes("keys")) {
|
||||||
|
agg.onboard.push(hm);
|
||||||
|
} else if (hm.exposes) {
|
||||||
|
hm.exposes.forEach((element) => {
|
||||||
|
let ic = agg.interconnects[element] || {
|
||||||
|
boards: [],
|
||||||
|
shields: [],
|
||||||
|
};
|
||||||
|
ic.boards.push(hm);
|
||||||
|
agg.interconnects[element] = ic;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.error("Board without keys or interconnect");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "shield":
|
||||||
|
if (hm.features && hm.features.includes("keys")) {
|
||||||
|
hm.requires.forEach((id) => {
|
||||||
|
let ic = agg.interconnects[id] || { boards: [], shields: [] };
|
||||||
|
ic.shields.push(hm);
|
||||||
|
agg.interconnects[id] = ic;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "interconnect":
|
||||||
|
let ic = agg.interconnects[hm.id] || { boards: [], shields: [] };
|
||||||
|
ic.interconnect = hm;
|
||||||
|
agg.interconnects[hm.id] = ic;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return agg;
|
||||||
|
},
|
||||||
|
{ onboard: [], interconnects: {} });
|
||||||
|
|
||||||
|
return JSON.stringify(grouped).replace(/\\/g,"\\\\").replace(/`/g,"\\`");
|
||||||
|
result-encoding: string
|
||||||
|
get-changed-files:
|
||||||
|
if: ${{ github.event_name != 'schedule' }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
changed-files: ${{ steps.changed-files.outputs.all }}
|
||||||
|
board-changes: ${{ steps.board-changes.outputs.result }}
|
||||||
|
core-changes: ${{ steps.core-changes.outputs.result }}
|
||||||
|
steps:
|
||||||
|
- uses: Ana06/get-changed-files@v2.0.0
|
||||||
|
id: changed-files
|
||||||
|
with:
|
||||||
|
format: "json"
|
||||||
|
- uses: actions/github-script@v4
|
||||||
|
id: board-changes
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
|
||||||
|
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
|
||||||
|
return boardChanges.length ? 'true' : 'false';
|
||||||
|
result-encoding: string
|
||||||
|
- uses: actions/github-script@v4
|
||||||
|
id: core-changes
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const changedFiles = JSON.parse(`${{ steps.changed-files.outputs.all }}`);
|
||||||
|
const boardChanges = changedFiles.filter(f => f.startsWith('app/boards'));
|
||||||
|
const appChanges = changedFiles.filter(f => f.startsWith('app'));
|
||||||
|
const ymlChanges = changedFiles.includes('.github/workflows/build.yml');
|
||||||
|
return boardChanges.length < appChanges.length || ymlChanges ? 'true' : 'false';
|
||||||
|
result-encoding: string
|
||||||
|
|
||||||
8
.github/workflows/build.yml
vendored
8
.github/workflows/build.yml
vendored
@@ -2,4 +2,10 @@ on: [push, pull_request, workflow_dispatch]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@main
|
uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@v0.3
|
||||||
|
|
||||||
|
---
|
||||||
|
include:
|
||||||
|
- board: nice_nano_v2
|
||||||
|
shield: sofle_left
|
||||||
|
snippet: zmk-usb-logging
|
||||||
|
|||||||
12
build.yaml
12
build.yaml
@@ -1,9 +1,13 @@
|
|||||||
include:
|
include:
|
||||||
- board: nice_nano_v2
|
- board: nice_nano@2.0.0
|
||||||
shield: corne_left
|
shield: corne_left
|
||||||
- board: nice_nano_v2
|
snippet: zmk-usb-logging
|
||||||
|
- board: nice_nano@2.0.0
|
||||||
shield: corne_right
|
shield: corne_right
|
||||||
- board: nice_nano_v2
|
snippet: zmk-usb-logging
|
||||||
|
- board: nice_nano@2.0.0
|
||||||
shield: sofle_left
|
shield: sofle_left
|
||||||
- board: nice_nano_v2
|
snippet: zmk-usb-logging
|
||||||
|
- board: nice_nano@2.0.0
|
||||||
shield: sofle_right
|
shield: sofle_right
|
||||||
|
snippet: zmk-usb-logging
|
||||||
|
|||||||
@@ -15,3 +15,13 @@
|
|||||||
# By default toggling the underglow on and off also toggles external power
|
# By default toggling the underglow on and off also toggles external power
|
||||||
# on and off. This also causes the display to turn off.
|
# on and off. This also causes the display to turn off.
|
||||||
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n
|
# CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=n
|
||||||
|
|
||||||
|
# Debounce
|
||||||
|
CONFIG_ZMK_KSCAN_DEBOUNCE_PRESS_MS=10
|
||||||
|
CONFIG_ZMK_KSCAN_DEBOUNCE_RELEASE_MS=10
|
||||||
|
|
||||||
|
# No sleeping
|
||||||
|
CONFIG_ZMK_SLEEP=n
|
||||||
|
|
||||||
|
# Still hunting my sticky key bug!
|
||||||
|
CONFIG_ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE=10
|
||||||
|
|||||||
@@ -6,9 +6,8 @@
|
|||||||
|
|
||||||
#include <behaviors.dtsi>
|
#include <behaviors.dtsi>
|
||||||
#include <dt-bindings/zmk/bt.h>
|
#include <dt-bindings/zmk/bt.h>
|
||||||
#include <dt-bindings/zmk/ext_power.h>
|
|
||||||
#include <dt-bindings/zmk/keys.h>
|
#include <dt-bindings/zmk/keys.h>
|
||||||
#include <dt-bindings/zmk/rgb.h>
|
#include <dt-bindings/zmk/outputs.h>
|
||||||
|
|
||||||
#define BASE 0
|
#define BASE 0
|
||||||
#define LOWER 1
|
#define LOWER 1
|
||||||
@@ -18,40 +17,85 @@
|
|||||||
/ {
|
/ {
|
||||||
// Activate ADJUST layer by pressing raise and lower
|
// Activate ADJUST layer by pressing raise and lower
|
||||||
|
|
||||||
conditional_layers {
|
left_encoder: encoder_left {
|
||||||
compatible = "zmk,conditional-layers";
|
compatible = "alps,ec11";
|
||||||
|
label = "LEFT_ENCODER";
|
||||||
|
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||||
|
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||||
|
steps = <80>;
|
||||||
|
};
|
||||||
|
|
||||||
both-mod {
|
right_encoder: encoder_right {
|
||||||
if-layers = <1 3>;
|
compatible = "alps,ec11";
|
||||||
then-layer = <3>;
|
label = "RIGHT_ENCODER";
|
||||||
|
a-gpios = <&pro_micro 21 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||||
|
b-gpios = <&pro_micro 20 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
|
||||||
|
steps = <80>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
sensors {
|
||||||
|
compatible = "zmk,keymap-sensors";
|
||||||
|
sensors = <&left_encoder &right_encoder>;
|
||||||
|
triggers-per-rotation = <20>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
conditional_layers { compatible = "zmk,conditional-layers"; };
|
||||||
|
|
||||||
behaviors {
|
behaviors {
|
||||||
macro_mirror: macro_mirror {
|
mtd: mtd {
|
||||||
compatible = "zmk,behavior-tap-dance";
|
compatible = "zmk,behavior-tap-dance";
|
||||||
label = "MACRO_MIRROR";
|
label = "Mod-Tap-Dance";
|
||||||
#binding-cells = <0>;
|
#binding-cells = <0>;
|
||||||
bindings = <&sl 5>, <&tog 8>;
|
bindings = <&mo 2>, <&tog 3>, <&sl 5>;
|
||||||
|
};
|
||||||
|
|
||||||
|
shift_caps_l: shift_caps_l {
|
||||||
|
compatible = "zmk,behavior-tap-dance";
|
||||||
|
label = "SHIFT_CAPS_L";
|
||||||
|
#binding-cells = <0>;
|
||||||
|
bindings = <&kp LSHFT>, <&kp CAPS>;
|
||||||
|
};
|
||||||
|
|
||||||
|
shift_caps_r: shift_caps_r {
|
||||||
|
compatible = "zmk,behavior-tap-dance";
|
||||||
|
label = "SHIFT_CAPS_R";
|
||||||
|
#binding-cells = <0>;
|
||||||
|
bindings = <&kp RSHFT>, <&kp CAPS>;
|
||||||
|
};
|
||||||
|
|
||||||
|
hlt: hlt {
|
||||||
|
compatible = "zmk,behavior-hold-tap";
|
||||||
|
label = "HLT";
|
||||||
|
bindings = <&mo>, <&kp>;
|
||||||
|
|
||||||
|
#binding-cells = <2>;
|
||||||
|
tapping-term-ms = <200>;
|
||||||
|
flavor = "hold-preferred";
|
||||||
|
retro-tap;
|
||||||
|
};
|
||||||
|
|
||||||
|
th: th {
|
||||||
|
compatible = "zmk,behavior-hold-tap";
|
||||||
|
label = "TH";
|
||||||
|
bindings = <&kp>, <&kp>;
|
||||||
|
|
||||||
|
#binding-cells = <2>;
|
||||||
|
flavor = "tap-preferred";
|
||||||
|
tapping-term-ms = <300>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
combos {
|
combos {
|
||||||
compatible = "zmk,combos";
|
compatible = "zmk,combos";
|
||||||
|
|
||||||
macro {
|
|
||||||
bindings = <¯o_mirror>;
|
|
||||||
key-positions = <50 51 52>;
|
|
||||||
};
|
|
||||||
|
|
||||||
qwerty {
|
qwerty {
|
||||||
bindings = <&tog 6>;
|
bindings = <&tog 4>;
|
||||||
key-positions = <57 58 59>;
|
key-positions = <57 58 59>;
|
||||||
};
|
};
|
||||||
|
|
||||||
left-space {
|
CAPS_COMBO {
|
||||||
bindings = <&kp SPACE>;
|
bindings = <&kp CAPS>;
|
||||||
key-positions = <39 40>;
|
key-positions = <49 36>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -59,7 +103,7 @@
|
|||||||
compatible = "zmk,keymap";
|
compatible = "zmk,keymap";
|
||||||
|
|
||||||
base {
|
base {
|
||||||
label = "base";
|
label = "Base";
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------------------
|
||||||
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
|
// | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
|
||||||
@@ -69,20 +113,40 @@
|
|||||||
// | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI |
|
// | GUI | ALT | CTRL | LOWER| ENTER | | SPACE | RAISE| CTRL | ALT | GUI |
|
||||||
|
|
||||||
bindings = <
|
bindings = <
|
||||||
&kp GRAVE &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &none
|
&th F12 ESCAPE &th F1 N1 &th F2 N2 &th F3 N3 &th F4 N4 &th F5 N5 &th F6 N6 &th F7 N7 &th F8 N8 &th F9 N9 &th F10 N0 &th F11 MINUS
|
||||||
&kp ESC &kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &kp SEMI &none
|
&kp TAB &kp Q &kp W &kp F &kp P &kp G &kp J &kp L &kp U &kp Y &kp SEMI &kp GRAVE
|
||||||
&kp BSPC &kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O &kp DEL
|
&kp BSPC &kp A &kp R &kp S &kp T &kp D &kp H &kp N &kp E &kp I &kp O &kp SINGLE_QUOTE
|
||||||
&kp LSHFT &kp Z &kp X &kp C &kp V &kp B &tog 4 &tog 4 &kp K &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHFT
|
&kp LEFT_SHIFT &kp Z &kp X &kp C &kp V &kp B &kp C_MUTE &kp C_PLAY_PAUSE &kp K &kp M &kp COMMA &kp DOT &kp FSLH &kp RSHIFT
|
||||||
&kp LCTRL &kp LEFT_WIN &kp LALT &mo 1 &kp RET &kp SPACE &mo 2 &kp RALT &kp RIGHT_WIN &kp RIGHT_CONTROL
|
&kp LCTRL &kp LEFT_WIN &kp LALT &hlt 2 SPACE &hlt 1 RET &hlt 1 ENTER &hlt 2 SPACE &kp RALT &kp RIGHT_WIN &kp RIGHT_CONTROL
|
||||||
>;
|
>;
|
||||||
|
|
||||||
sensor-bindings =
|
|
||||||
<&inc_dec_kp UP_ARROW DOWN_ARROW>,
|
|
||||||
<&inc_dec_kp K_SCROLL_UP K_SCROLL_DOWN>;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
left-mod {
|
mirrored {
|
||||||
label = "left-mod";
|
bindings = <
|
||||||
|
&th F11 MINUS &th F10 N0 &th F9 N9 &th F8 N8 &th F7 N7 &th F6 N6 &th F5 N5 &th F4 N4 &th F3 N3 &th F2 N2 &th F1 N1 &th F12 ESCAPE
|
||||||
|
&kp GRAVE &kp SEMI &kp Y &kp U &kp L &kp J &kp G &kp P &kp F &kp W &kp Q &kp TAB
|
||||||
|
&kp SQT &kp O &kp I &kp E &kp N &kp H &kp D &kp T &kp S &kp R &kp A &kp BSPC
|
||||||
|
&kp LEFT_SHIFT &kp FSLH &kp DOT &kp COMMA &kp M &kp K &trans &trans &kp B &kp V &kp C &kp X &kp Z &kp RIGHT_SHIFT
|
||||||
|
&kp RCTRL &kp RGUI &kp RALT &trans &trans &trans &trans &kp LALT &kp LGUI &kp LCTRL
|
||||||
|
>;
|
||||||
|
|
||||||
|
label = "Mirrored";
|
||||||
|
};
|
||||||
|
|
||||||
|
mod_a {
|
||||||
|
bindings = <
|
||||||
|
&kp EQUAL &kp LBKT &kp RBKT &trans &trans &trans &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
|
||||||
|
&kp NON_US_HASH &trans &trans &trans &trans &trans &mt F7 KP_NUMBER_7 &mt F8 KP_NUMBER_8 &mt F9 KP_NUMBER_9 &kp KP_ASTERISK &kp KP_DIVIDE &kp NON_US_HASH
|
||||||
|
&kp DELETE &kp INS &kp HOME &kp UP &kp END &kp PG_UP &mt F4 KP_NUMBER_4 &mt F5 KP_NUMBER_5 &mt F6 KP_NUMBER_6 &kp KP_PLUS &kp KP_MINUS &kp BACKSPACE
|
||||||
|
&kp LSHIFT &kp NUBS &kp LEFT &kp DOWN &kp RIGHT &kp PAGE_DOWN &trans &trans &mt F1 KP_NUMBER_1 &mt F2 KP_NUMBER_2 &mt F3 KP_NUMBER_3 &kp KP_DOT &kp KP_EQUAL &kp RSHIFT
|
||||||
|
&trans &trans &trans &trans &tog 3 &tog 3 &trans &kp KP_NUMBER_0 &trans &trans
|
||||||
|
>;
|
||||||
|
|
||||||
|
label = "Mod A";
|
||||||
|
};
|
||||||
|
|
||||||
|
mod_b {
|
||||||
|
label = "Mod b";
|
||||||
|
|
||||||
// TODO: Some binds are waiting for shifted keycode support.
|
// TODO: Some binds are waiting for shifted keycode support.
|
||||||
// ------------------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------------------
|
||||||
@@ -93,104 +157,36 @@
|
|||||||
// | | | | | | | | | | | |
|
// | | | | | | | | | | | |
|
||||||
|
|
||||||
bindings = <
|
bindings = <
|
||||||
&trans &trans &trans &trans &trans &trans &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6
|
&kp EQUAL &kp LEFT_BRACKET &kp RIGHT_BRACKET &trans &trans &trans &trans &trans &trans &kp LEFT_BRACKET &kp RIGHT_BRACKET &kp EQUAL
|
||||||
&trans &kp KP_DIVIDE &kp KP_N7 &kp KP_N8 &kp KP_N9 &kp KP_MULTIPLY &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12
|
&kp KP_NUMLOCK &kp KP_DIVIDE &kp KP_MULTIPLY &mt F7 KP_NUMBER_7 &mt F8 KP_NUMBER_8 &mt F9 KP_NUMBER_9 &trans &trans &trans &trans &trans &kp NON_US_HASH
|
||||||
&kp DELETE &kp KP_SUBTRACT &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS &kp PG_UP &kp HOME &kp UP &kp END &trans &kp BACKSPACE
|
&kp BACKSPACE &kp KP_SUBTRACT &kp KP_PLUS &mt F4 KP_NUMBER_4 &mt F5 KP_NUMBER_5 &mt F6 KP_NUMBER_6 &kp PG_UP &kp HOME &kp UP &kp END &kp INS &kp DELETE
|
||||||
&trans &kp KP_N0 &kp KP_N1 &kp KP_NUMBER_2 &kp KP_N3 &kp KP_DOT &trans &trans &kp PG_DN &kp LEFT &kp DOWN &kp RIGHT &trans &trans
|
&kp LEFT_SHIFT &kp KP_EQUAL &kp KP_DOT &mt F1 KP_NUMBER_1 &mt F2 KP_NUMBER_2 &mt F3 KP_NUMBER_3 &trans &trans &kp PAGE_DOWN &kp LEFT &kp DOWN &kp RIGHT &kp NUBS &kp RIGHT_SHIFT
|
||||||
&trans &trans &trans &tog 1 &trans &trans &trans &trans &trans &trans
|
&trans &trans &kp KP_N0 &tog 3 &mo 5 &mo 5 &tog 3 &trans &trans &trans
|
||||||
>;
|
>;
|
||||||
};
|
};
|
||||||
|
|
||||||
right-mod {
|
|
||||||
bindings = <
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &kp LBKT &kp RBKT &kp MINUS &kp EQUAL &trans
|
|
||||||
&kp DEL &trans &trans &trans &trans &trans &trans &kp LEFT_PARENTHESIS &kp RIGHT_PARENTHESIS &kp SQT &kp NON_US_HASH &kp BSPC
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &kp LBRC &kp RIGHT_BRACE &kp PIPE &kp NON_US_BACKSLASH &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
>;
|
|
||||||
|
|
||||||
label = "right-mod";
|
|
||||||
};
|
|
||||||
|
|
||||||
both-mod {
|
|
||||||
// ----------------------------------------------------------------------------------------------------------------------------
|
|
||||||
// | BTCLR | BT1 | BT2 | BT3 | BT4 | BT5 | | | | | | | |
|
|
||||||
// | EXTPWR | RGB_HUD | RGB_HUI | RGB_SAD | RGB_SAI | RGB_EFF | | | | | | | |
|
|
||||||
// | | RGB_BRD | RGB_BRI | | | | | | | | | | |
|
|
||||||
// | | | | | | | RGB_TOG | | | | | | | | |
|
|
||||||
// | | | | | | | | | | | |
|
|
||||||
|
|
||||||
label = "both-mod";
|
|
||||||
bindings = <
|
|
||||||
&bt BT_CLR &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &none &none &none &none &none &none
|
|
||||||
&ext_power EP_TOG &rgb_ug RGB_HUD &rgb_ug RGB_HUI &rgb_ug RGB_SAD &rgb_ug RGB_SAI &rgb_ug RGB_EFF &none &none &none &none &none &none
|
|
||||||
&none &rgb_ug RGB_BRD &rgb_ug RGB_BRI &none &none &none &none &none &none &none &none &none
|
|
||||||
&none &none &none &none &none &none &rgb_ug RGB_TOG &none &none &none &none &none &none &none
|
|
||||||
&none &none &none &none &none &none &none &none &none &none
|
|
||||||
>;
|
|
||||||
};
|
|
||||||
|
|
||||||
encoder-alt {
|
|
||||||
bindings = <
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
>;
|
|
||||||
|
|
||||||
sensor-bindings =
|
|
||||||
<&inc_dec_kp UP_ARROW DOWN>,
|
|
||||||
<&inc_dec_kp PAGE_UP PAGE_DOWN>;
|
|
||||||
|
|
||||||
label = "encoder-alt";
|
|
||||||
};
|
|
||||||
|
|
||||||
macro {
|
|
||||||
bindings = <
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
>;
|
|
||||||
|
|
||||||
label = "macro";
|
|
||||||
};
|
|
||||||
|
|
||||||
qwerty {
|
qwerty {
|
||||||
bindings = <
|
bindings = <
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||||
&trans &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &trans
|
&trans &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &trans
|
||||||
&trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &trans
|
&trans &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &trans
|
||||||
&trans &kp Z &kp X &kp C &kp V &kp B &trans &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &trans
|
&kp LEFT_SHIFT &kp Z &kp X &kp C &kp V &kp B &trans &trans &kp N &kp M &kp COMMA &kp DOT &kp FSLH &kp RIGHT_SHIFT
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||||
>;
|
>;
|
||||||
|
|
||||||
label = "qwerty";
|
label = "QWERTY";
|
||||||
};
|
};
|
||||||
|
|
||||||
mirror-mod {
|
conf {
|
||||||
bindings = <
|
bindings = <
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&sys_reset &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &trans &trans &trans &trans &trans &sys_reset
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&bootloader &bt BT_DISC 0 &bt BT_DISC 1 &bt BT_DISC 2 &bt BT_DISC 3 &bt BT_DISC 4 &trans &trans &trans &trans &trans &bootloader
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&trans &trans &out OUT_USB &bt BT_CLR_ALL &out OUT_BLE &trans &trans &trans &trans &trans &trans &trans
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&trans &trans &bt BT_PRV &bt BT_CLR &bt BT_NXT &studio_unlock &trans &trans &trans &trans &trans &trans &trans &trans
|
||||||
&trans &trans &trans &mo 8 &trans &trans &trans &trans &trans &trans
|
|
||||||
>;
|
|
||||||
|
|
||||||
label = "mirror-mod";
|
|
||||||
};
|
|
||||||
|
|
||||||
mirror {
|
|
||||||
bindings = <
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &kp SEMI &kp Y &kp U &kp L &kp J &trans &trans &trans &trans &trans &trans
|
|
||||||
&kp DEL &kp O &kp I &kp E &kp N &kp H &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &kp FSLH &kp DOT &kp COMMA &kp M &kp K &trans &trans &trans &trans &trans &trans &trans &trans
|
|
||||||
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
label = "conf";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ manifest:
|
|||||||
projects:
|
projects:
|
||||||
- name: zmk
|
- name: zmk
|
||||||
remote: zmkfirmware
|
remote: zmkfirmware
|
||||||
revision: main
|
revision: v0.3
|
||||||
import: app/west.yml
|
import: app/west.yml
|
||||||
self:
|
self:
|
||||||
path: config
|
path: config
|
||||||
|
|||||||
Reference in New Issue
Block a user