Skip to content

Commit 92d62d0

Browse files
committed
Initial structure.
0 parents  commit 92d62d0

File tree

12 files changed

+506
-0
lines changed

12 files changed

+506
-0
lines changed

.clang-format

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
BasedOnStyle: Google
3+
AlignAfterOpenBracket: Align
4+
AlignConsecutiveAssignments: 'true'
5+
AlignConsecutiveDeclarations: 'true'
6+
AlignOperands: 'true'
7+
AllowAllParametersOfDeclarationOnNextLine: 'false'
8+
AllowShortCaseLabelsOnASingleLine: 'false'
9+
AllowShortFunctionsOnASingleLine: Empty
10+
AllowShortLoopsOnASingleLine: 'false'
11+
AlwaysBreakAfterDefinitionReturnType: None
12+
AlwaysBreakAfterReturnType: None
13+
AlwaysBreakBeforeMultilineStrings: 'false'
14+
BinPackArguments: 'true'
15+
BinPackParameters: 'true'
16+
ColumnLimit: '1000'
17+
IndentCaseLabels: 'true'
18+
IndentPPDirectives: AfterHash
19+
IndentWidth: '4'
20+
MaxEmptyLinesToKeep: '1'
21+
PointerAlignment: Right
22+
SortIncludes: 'false'
23+
SpaceBeforeAssignmentOperators: 'true'
24+
SpaceBeforeParens: ControlStatements
25+
SpaceInEmptyParentheses: 'false'
26+
SpacesBeforeTrailingComments: 1
27+
TabWidth: '4'
28+
UseTab: Never
29+
30+
...

.clangd

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
CompileFlags:
2+
Add: [-Wno-unknown-attributes, -Wno-maybe-uninitialized, -Wno-unknown-warning-option]
3+
Remove: [-W*, -mcall-prologues]
4+
Compiler: clang

.editorconfig

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2+
# editorconfig.org
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
9+
# We recommend you to keep these unchanged
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
indent_size = 4
17+
18+
[{qmk,*.py}]
19+
charset = utf-8
20+
max_line_length = 200
21+
22+
# Make these match what we have in .gitattributes
23+
[*.mk]
24+
end_of_line = lf
25+
indent_style = tab
26+
27+
[Makefile]
28+
end_of_line = lf
29+
indent_style = tab
30+
31+
[*.sh]
32+
end_of_line = lf

.github/workflows/build_binaries.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Build QMK firmware
2+
3+
on: [push, workflow_dispatch]
4+
5+
permissions:
6+
contents: write
7+
8+
jobs:
9+
build:
10+
name: 'QMK Userspace Build'
11+
uses: qmk/.github/.github/workflows/qmk_userspace_build.yml@qmk-userspace
12+
with:
13+
qmk_repo: qmk/qmk_firmware
14+
qmk_ref: master
15+
16+
publish:
17+
name: 'QMK Userspace Publish'
18+
uses: qmk/.github/.github/workflows/qmk_userspace_publish.yml@qmk-userspace
19+
if: always() && !cancelled()
20+
needs: build

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.hex
2+
*.bin
3+
*.uf2

LICENSE

+339
Large diffs are not rendered by default.

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.SILENT:
2+
3+
MAKEFLAGS += --no-print-directory
4+
5+
QMK_USERSPACE := $(patsubst %/,%,$(dir $(shell realpath "$(lastword $(MAKEFILE_LIST))")))
6+
ifeq ($(QMK_USERSPACE),)
7+
QMK_USERSPACE := $(shell pwd)
8+
endif
9+
10+
QMK_FIRMWARE_ROOT = $(shell qmk config -ro user.qmk_home | cut -d= -f2 | sed -e 's@^None$$@@g')
11+
ifeq ($(QMK_FIRMWARE_ROOT),)
12+
$(error Cannot determine qmk_firmware location. `qmk config -ro user.qmk_home` is not set)
13+
endif
14+
15+
%:
16+
+$(MAKE) -C $(QMK_FIRMWARE_ROOT) $(MAKECMDGOALS) QMK_USERSPACE=$(QMK_USERSPACE)

README.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# QMK Userspace
2+
3+
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.
4+
5+
## Howto configure your build targets
6+
7+
1. Run the normal `qmk setup` procedure if you haven't already done so -- see [QMK Docs](https://docs.qmk.fm/#/newbs) for details.
8+
1. Fork this repository
9+
1. Clone your fork to your local machine
10+
1. Add a new keymap for your board using `qmk new-keymap`
11+
* 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/<your keymap name>`
12+
* You can also create a new keymap using `qmk new-keymap -kb <your_keyboard> -km <your_keymap>`
13+
* Alternatively, add your keymap manually by placing it in the location specified above.
14+
* `layouts/<layout name>/<your keymap name>/keymap.*` is also supported if you prefer the layout system
15+
1. Add your keymap(s) to the build by running `qmk userspace-add -kb <your_keyboard> -km <your_keymap>`
16+
* This will automatically update your `qmk.json` file
17+
* Corresponding `qmk userspace-remove -kb <your_keyboard> -km <your_keymap>` will delete it
18+
* Listing the build targets can be done with with `qmk userspace-list`
19+
1. Commit your changes
20+
21+
## Howto build with GitHub
22+
23+
1. In the GitHub Actions tab, enable workflows
24+
1. Push your changes above to your forked GitHub repository
25+
1. Look at the GitHub Actions for a new actions run
26+
1. Wait for the actions run to complete
27+
1. Inspect the Releases tab on your repository for the latest firmware build
28+
29+
## Howto build locally
30+
31+
1. Run the normal `qmk setup` procedure if you haven't already done so -- see [QMK Docs](https://docs.qmk.fm/#/newbs) for details.
32+
1. Fork this repository
33+
1. Clone your fork to your local machine
34+
1. `cd` into this repository's clone directory
35+
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
36+
* 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.
37+
1. Compile normally: `qmk compile -kb your_keyboard -km your_keymap` or `make your_keyboard:your_keymap`
38+
39+
Alternatively, if you configured your build targets above, you can use `qmk userspace-compile` to build all of your userspace targets at once.
40+
41+
## Extra info
42+
43+
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.
44+
45+
To override the `build` job, you can change the following parameters to use a different QMK repository or branch:
46+
```
47+
with:
48+
qmk_repo: qmk/qmk_firmware
49+
qmk_ref: master
50+
```
51+
52+
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.
53+
54+
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.
55+
56+
1. (First time only) `git submodule add https://github.com/qmk/qmk_firmware.git`
57+
1. (To update) `git submodule update --init --recursive`
58+
1. Commit your changes to your userspace repository

keyboards/.keep

Whitespace-only changes.

layouts/.keep

Whitespace-only changes.

qmk.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"userspace_version": "1.0",
3+
"build_targets": []
4+
}

users/.keep

Whitespace-only changes.

0 commit comments

Comments
 (0)