From 5212d63b29a307d80347d4c0c26b6ea55c60b08c Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Wed, 22 Nov 2023 21:12:34 +1100 Subject: [PATCH 1/9] Updated `.gitignore`. --- .gitignore | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cd76b1db..ec5cfa2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,11 @@ +# Junk files +*.bak +*.swp +*~ +.DS_Store +._* + +# Firmware files *.hex *.bin -*.uf2 \ No newline at end of file +*.uf2 From c8dcd9291beb7ad4ff6570d4a9c11b4efcf58024 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 28 Nov 2023 16:44:02 +1100 Subject: [PATCH 2/9] Point workflows at `qmk/.github`s `main` branch (#1) --- .github/workflows/build_binaries.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_binaries.yaml b/.github/workflows/build_binaries.yaml index 6cb3aa3a..f7908fad 100755 --- a/.github/workflows/build_binaries.yaml +++ b/.github/workflows/build_binaries.yaml @@ -8,13 +8,13 @@ permissions: jobs: build: name: 'QMK Userspace Build' - uses: qmk/.github/.github/workflows/qmk_userspace_build.yml@qmk-userspace + uses: qmk/.github/.github/workflows/qmk_userspace_build.yml@main with: qmk_repo: qmk/qmk_firmware qmk_ref: master publish: name: 'QMK Userspace Publish' - uses: qmk/.github/.github/workflows/qmk_userspace_publish.yml@qmk-userspace + uses: qmk/.github/.github/workflows/qmk_userspace_publish.yml@main if: always() && !cancelled() needs: build From 67fac7803e28c485bbd23c47cd5bb92de61e3763 Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Fri, 23 Feb 2024 22:35:45 +1100 Subject: [PATCH 3/9] Add support for devcontainers. (#6) --- .devcontainer/devcontainer.json | 33 +++++++++++++++++++++++++++++++++ .devcontainer/setup.sh | 21 +++++++++++++++++++++ .vscode/extensions.json | 12 ++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .devcontainer/devcontainer.json create mode 100755 .devcontainer/setup.sh create mode 100644 .vscode/extensions.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..2b7b817a --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,33 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/debian +{ + "name": "QMK CLI", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "ghcr.io/qmk/qmk_cli", + "customizations": { + "vscode": { + "extensions": [ + "amodio.toggle-excluded-files", + "EditorConfig.EditorConfig", + "xaver.clang-format", + "llvm-vs-code-extensions.vscode-clangd", + "bierner.github-markdown-preview", + "donjayamanne.git-extension-pack", + "ms-vscode-remote.remote-containers" + ] + } + }, + "postCreateCommand": "/workspaces/qmk_userspace/.devcontainer/setup.sh" + + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" +} diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh new file mode 100755 index 00000000..25c7c5ee --- /dev/null +++ b/.devcontainer/setup.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +set -eEuo pipefail + +wget https://bootstrap.pypa.io/get-pip.py +python3 get-pip.py +python3 -m pip install qmk +rm get-pip.py + +python3 -m pip install --upgrade milc + +git config --global --add safe.directory /workspaces/qmk_userspace +git submodule update --init --recursive + +[ -d /workspaces/qmk_firmware ] || git clone https://github.com/qmk/qmk_firmware.git /workspaces/qmk_firmware +git config --global --add safe.directory /workspaces/qmk_firmware + +qmk config user.qmk_home=/workspaces/qmk_firmware +qmk config user.overlay_dir=/workspaces/qmk_userspace + +qmk git-submodule diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..3984e9be --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,12 @@ +// Suggested extensions +{ + "recommendations": [ + "amodio.toggle-excluded-files", + "EditorConfig.EditorConfig", + "xaver.clang-format", + "llvm-vs-code-extensions.vscode-clangd", + "bierner.github-markdown-preview", + "donjayamanne.git-extension-pack", + "ms-vscode-remote.remote-containers" + ] +} From 6ddb67dc5621c9aa97ff8a1c7188add77ef3304f Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Thu, 2 May 2024 20:11:50 +1000 Subject: [PATCH 4/9] Replicate qmk/qmk_firmware#23310 --- .clangd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clangd b/.clangd index 2be2d817..6133ae72 100644 --- a/.clangd +++ b/.clangd @@ -1,4 +1,4 @@ CompileFlags: Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option] - Remove: [-W*, -mcall-prologues] + Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues] Compiler: clang From 7672002109b5856fc1b43df292bca4836fdb99d5 Mon Sep 17 00:00:00 2001 From: Vitaliy Zaytsev Date: Thu, 2 May 2024 14:20:54 +0300 Subject: [PATCH 5/9] use containerWorkspaceFolder var and pass it to setup.sh (#12) - folder name inside dev container is same as folder name on host so if it differs from qmk_userspace then setup.sh cannot be found and it sets incorrect user.overlay_dir - docs https://containers.dev/implementors/json_reference/ --- .devcontainer/devcontainer.json | 2 +- .devcontainer/setup.sh | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2b7b817a..7aaee1fd 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -17,7 +17,7 @@ ] } }, - "postCreateCommand": "/workspaces/qmk_userspace/.devcontainer/setup.sh" + "postCreateCommand": "${containerWorkspaceFolder}/.devcontainer/setup.sh ${containerWorkspaceFolder}" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, diff --git a/.devcontainer/setup.sh b/.devcontainer/setup.sh index 25c7c5ee..9155c6cc 100755 --- a/.devcontainer/setup.sh +++ b/.devcontainer/setup.sh @@ -9,13 +9,15 @@ rm get-pip.py python3 -m pip install --upgrade milc -git config --global --add safe.directory /workspaces/qmk_userspace +userspacePath="$1" + +git config --global --add safe.directory "$userspacePath" git submodule update --init --recursive [ -d /workspaces/qmk_firmware ] || git clone https://github.com/qmk/qmk_firmware.git /workspaces/qmk_firmware git config --global --add safe.directory /workspaces/qmk_firmware qmk config user.qmk_home=/workspaces/qmk_firmware -qmk config user.overlay_dir=/workspaces/qmk_userspace +qmk config user.overlay_dir="$userspacePath" qmk git-submodule From 0f10c50b4cf01d4dad4e9d19d1655207b37fb81e Mon Sep 17 00:00:00 2001 From: arisudesu Date: Wed, 12 Jun 2024 06:00:54 +0300 Subject: [PATCH 6/9] Add `qmk config user.overlay_dir` step to README.md (#23) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 72b7d82c..9a96cbe3 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ This is a template repository which allows for an external set of QMK keymaps to 1. Run the normal `qmk setup` procedure if you haven't already done so -- see [QMK Docs](https://docs.qmk.fm/#/newbs) for details. 1. Fork this repository 1. Clone your fork to your local machine +1. Enable userspace in QMK config using `qmk config user.overlay_dir="$(realpath qmk_userspace)"` 1. Add a new keymap for your board using `qmk new-keymap` * This will create a new keymap in the `keyboards` directory, in the same location that would normally be used in the main QMK repository. For example, if you wanted to add a keymap for the Planck, it will be created in `keyboards/planck/keymaps/` * You can also create a new keymap using `qmk new-keymap -kb -km ` @@ -55,4 +56,4 @@ This can also be used to control which fork is used, though only upstream `qmk_f 1. (First time only) `git submodule add https://github.com/qmk/qmk_firmware.git` 1. (To update) `git submodule update --init --recursive` -1. Commit your changes to your userspace repository \ No newline at end of file +1. Commit your changes to your userspace repository From e6f22f98b2b1b0c00d6eefa205d8a09e29d3f04f Mon Sep 17 00:00:00 2001 From: Chad Skeeters Date: Thu, 29 Aug 2024 21:27:51 -0500 Subject: [PATCH 7/9] Removes duplicated word *with* in README.md (#29) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9a96cbe3..25208997 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ This is a template repository which allows for an external set of QMK keymaps to 1. Add your keymap(s) to the build by running `qmk userspace-add -kb -km ` * This will automatically update your `qmk.json` file * Corresponding `qmk userspace-remove -kb -km ` will delete it - * Listing the build targets can be done with with `qmk userspace-list` + * Listing the build targets can be done with `qmk userspace-list` 1. Commit your changes ## Howto build with GitHub From 35edec2998d4ffd2d005966537d8be431795a3aa Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Thu, 5 Sep 2024 11:51:35 +0300 Subject: [PATCH 8/9] Add clangd-related entries to `.gitignore` (#31) This is needed to support VS Code with clangd for userspace keymaps (in this case `compile_commands.json` and `.cache/clangd` are located in the `qmk_userspace` working copy). --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitignore b/.gitignore index ec5cfa2b..800a4e2c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,8 @@ *.hex *.bin *.uf2 + +# clangd +compile_commands.json +.clangd/ +.cache/ From 41ee8332d1ed1f897611fd8feb7d4e30a2acb76b Mon Sep 17 00:00:00 2001 From: Nick Brassel Date: Tue, 22 Apr 2025 00:05:04 +1000 Subject: [PATCH 9/9] Fix for `.clangd`. --- .clangd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.clangd b/.clangd index 6133ae72..63dadd7e 100644 --- a/.clangd +++ b/.clangd @@ -1,4 +1,4 @@ CompileFlags: Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option] - Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues] + Remove: [-W*, -mmcu=*, -mcpu=*, -mfpu=*, -mfloat-abi=*, -mno-unaligned-access, -mno-thumb-interwork, -mcall-prologues, -D__has_include*] Compiler: clang