aboutsummaryrefslogtreecommitdiffstats
path: root/docs/feature_userspace.md
blob: edc9f6e32ee5249afa55a9ca9e69a7d0bd9b80cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Userspace: sharing code between keymaps

If you use more than one keyboard with a similar keymap, you might see the benefit in being able to share code between them. Create your own folder in `users/` named the same as your keymap (ideally your github username, `<name>`) with the following structure:

* `/users/<name>/` (added to the path automatically)
  * `readme.md`
  * `rules.mk` (included automatically)
  * `<name>.h` (optional)
  * `<name>.c` (optional)

`<name>.c` will need to be added to the SRC in `rules.mk` like this:

    SRC += <name>.c

Additional files may be added in the same way - it's recommended you have one named `<name>`.c/.h though.

All this only happens when you build a keymap named `<name>`, like this:

    make planck:<name>

For example, 

    make planck:jack

Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`.

## Readme

Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses).

## Example

For a brief example, checkout `/users/_example/` until we have more reasonable and useful examples.