From: Cameron Otsuka Date: Wed, 12 Feb 2025 00:49:45 +0000 (-0800) Subject: update boilerplate X-Git-Url: https://git.otsuka.systems/?a=commitdiff_plain;h=c731718e0b864ae4bf5f693d9608c7ef8f90683c;p=qmk-keymaps update boilerplate --- diff --git a/.clang-format b/.clang-format deleted file mode 100644 index ce145e2..0000000 --- a/.clang-format +++ /dev/null @@ -1,30 +0,0 @@ ---- -BasedOnStyle: Google -AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: 'true' -AlignConsecutiveDeclarations: 'true' -AlignOperands: 'true' -AllowAllParametersOfDeclarationOnNextLine: 'false' -AllowShortCaseLabelsOnASingleLine: 'false' -AllowShortFunctionsOnASingleLine: Empty -AllowShortLoopsOnASingleLine: 'false' -AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: None -AlwaysBreakBeforeMultilineStrings: 'false' -BinPackArguments: 'true' -BinPackParameters: 'true' -ColumnLimit: '1000' -IndentCaseLabels: 'true' -IndentPPDirectives: AfterHash -IndentWidth: '4' -MaxEmptyLinesToKeep: '1' -PointerAlignment: Right -SortIncludes: 'false' -SpaceBeforeAssignmentOperators: 'true' -SpaceBeforeParens: ControlStatements -SpaceInEmptyParentheses: 'false' -SpacesBeforeTrailingComments: 1 -TabWidth: '4' -UseTab: Never - -... diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index 7aaee1f..0000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,33 +0,0 @@ -// 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": "${containerWorkspaceFolder}/.devcontainer/setup.sh ${containerWorkspaceFolder}" - - // 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 deleted file mode 100755 index 9155c6c..0000000 --- a/.devcontainer/setup.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/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 - -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="$userspacePath" - -qmk git-submodule diff --git a/.github/workflows/build_binaries.yaml b/.github/workflows/build_binaries.yaml index f7908fa..9f5d04d 100755 --- a/.github/workflows/build_binaries.yaml +++ b/.github/workflows/build_binaries.yaml @@ -10,7 +10,7 @@ jobs: name: 'QMK Userspace Build' uses: qmk/.github/.github/workflows/qmk_userspace_build.yml@main with: - qmk_repo: qmk/qmk_firmware + qmk_repo: Keychron/qmk_firmware qmk_ref: master publish: diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 3984e9b..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,12 +0,0 @@ -// 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" - ] -} diff --git a/README.md b/README.md index 2520899..7073865 100644 --- a/README.md +++ b/README.md @@ -1,59 +1,24 @@ -# QMK Userspace - -This is a template repository which allows for an external set of QMK keymaps to be defined and compiled. This is useful for users who want to maintain their own keymaps without having to fork the main QMK repository. - -## Howto configure your build targets - -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 ` - * Alternatively, add your keymap manually by placing it in the location specified above. - * `layouts///keymap.*` is also supported if you prefer the layout system -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 `qmk userspace-list` -1. Commit your changes - -## Howto build with GitHub - -1. In the GitHub Actions tab, enable workflows -1. Push your changes above to your forked GitHub repository -1. Look at the GitHub Actions for a new actions run -1. Wait for the actions run to complete -1. Inspect the Releases tab on your repository for the latest firmware build - -## Howto build locally +# qmk-keymaps +⌨️ qmk external userspace +## Instructions +### Compiling These Keymaps 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. Clone this repo. 1. `cd` into this repository's clone directory 1. Set global userspace path: `qmk config user.overlay_dir="$(realpath .)"` -- you MUST be located in the cloned userspace location for this to work correctly - * This will be automatically detected if you've `cd`ed into your userspace repository, but the above makes your userspace available regardless of your shell location. + - This will be automatically detected if you've `cd`ed into your userspace repository, but the above makes your userspace available regardless of your shell location. 1. Compile normally: `qmk compile -kb your_keyboard -km your_keymap` or `make your_keyboard:your_keymap` + - Alternatively, if you configured your build targets above, you can use `qmk userspace-compile` to build all of your userspace targets at once. -Alternatively, if you configured your build targets above, you can use `qmk userspace-compile` to build all of your userspace targets at once. - -## Extra info - -If you wish to point GitHub actions to a different repository, a different branch, or even a different keymap name, you can modify `.github/workflows/build_binaries.yml` to suit your needs. - -To override the `build` job, you can change the following parameters to use a different QMK repository or branch: -``` - with: - qmk_repo: qmk/qmk_firmware - qmk_ref: master -``` - -If you wish to manually manage `qmk_firmware` using git within the userspace repository, you can add `qmk_firmware` as a submodule in the userspace directory instead. GitHub Actions will automatically use the submodule at the pinned revision if it exists, otherwise it will use the default latest revision of `qmk_firmware` from the main repository. - -This can also be used to control which fork is used, though only upstream `qmk_firmware` will have support for external userspace until other manufacturers update their forks. - -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 +## Creating New Keymaps +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 ` + - Alternatively, add your keymap manually by placing it in the location specified above. + - `layouts///keymap.*` is also supported if you prefer the layout system +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 `qmk userspace-list` +1. Commit your changes diff --git a/keyboards/.keep b/keyboards/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/cotsuka/keymap.c b/keyboards/keychron/q10/ansi_encoder/keymaps/cotsuka/keymap.c new file mode 100644 index 0000000..2cabbaf --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/cotsuka/keymap.c @@ -0,0 +1,72 @@ +/* Copyright 2022 @ Keychron (https://www.keychron.com) + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include QMK_KEYBOARD_H + +// clang-format off + +enum layers{ + MAC_BASE, + MAC_FN, + WIN_BASE, + WIN_FN +}; + +#define KC_TASK LGUI(KC_TAB) +#define KC_FLXP LGUI(KC_E) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [MAC_BASE] = LAYOUT_ansi_89( + KC_MUTE, KC_ESC, KC_BRID, KC_BRIU, KC_NO, KC_NO, RM_VALD, RM_VALU, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_INS, KC_DEL, + _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + _______, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + _______, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + _______, KC_LCTL, KC_LOPT, KC_LCMD, KC_SPC, MO(MAC_FN), KC_SPC, KC_RCMD, KC_LEFT, KC_DOWN, KC_RGHT), + + [MAC_FN] = LAYOUT_ansi_89( + RM_TOGG, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RM_TOGG, RM_NEXT, RM_VALU, RM_HUEU, RM_SATU, RM_SPDU, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RM_PREV, RM_VALD, RM_HUED, RM_SATD, RM_SPDD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [WIN_BASE] = LAYOUT_ansi_89( + KC_MUTE, KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_DEL, + _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_PGUP, + _______, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_PGDN, + _______, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_HOME, + _______, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, + _______, KC_LCTL, KC_LWIN, KC_LALT, KC_SPC, MO(WIN_FN), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT), + + [WIN_FN] = LAYOUT_ansi_89( + RM_TOGG, _______, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RM_VALD, RM_VALU, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RM_TOGG, RM_NEXT, RM_VALU, RM_HUEU, RM_SATU, RM_SPDU, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RM_PREV, RM_VALD, RM_HUED, RM_SATD, RM_SPDD, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +#if defined(ENCODER_ENABLE) && defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [MAC_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [MAC_FN] = { ENCODER_CCW_CW(RM_VALD, RM_VALU) }, + [WIN_BASE] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [WIN_FN] = { ENCODER_CCW_CW(RM_VALD, RM_VALU) } +}; +#endif // ENCODER_MAP_ENABLE diff --git a/keyboards/keychron/q10/ansi_encoder/keymaps/cotsuka/rules.mk b/keyboards/keychron/q10/ansi_encoder/keymaps/cotsuka/rules.mk new file mode 100644 index 0000000..ee32568 --- /dev/null +++ b/keyboards/keychron/q10/ansi_encoder/keymaps/cotsuka/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/qmk.json b/qmk.json index 3afc389..7cc7984 100644 --- a/qmk.json +++ b/qmk.json @@ -1,4 +1,6 @@ { - "userspace_version": "1.0", - "build_targets": [] + "userspace_version": "1.1", + "build_targets": [ + ["keychron/q10/ansi_encoder", "cotsuka"] + ] } \ No newline at end of file diff --git a/users/.keep b/users/.keep deleted file mode 100644 index e69de29..0000000