Skip to content

Commit

Permalink
Restructure repo as an External QMK Userspace.
Browse files Browse the repository at this point in the history
This commit reorganizes the repo directories and adds files such that
it works as an External QMK Userspace
<https://docs.qmk.fm/#/newbs_external_userspace>.

To use in QMK, clone this repo, then run shell command

    qmk config user.overlay_dir="$(realpath path/to/qmk-keymap)"

Then compile or flash as usual with

    qmk flash -kb handwired/dactyl_promicro -km getreuer
  • Loading branch information
getreuer committed Apr 20, 2024
1 parent b55e875 commit d1f7520
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 120 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*.bin
*.hex
user_song_list.h
tools/qmk_song_player/main.js
tools/qmk_song_player/song.js
Expand Down
22 changes: 22 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-License-Identifier: GPL-2.0
#
# See https://qmk.fm/license/ for complete copy of the license.
# This file is part of GitHub repo qmk/qmk_userspace, copied from
# https://github.com/qmk/qmk_userspace/blob/main/Makefile

.SILENT:

MAKEFLAGS += --no-print-directory

QMK_USERSPACE := $(patsubst %/,%,$(dir $(shell realpath "$(lastword $(MAKEFILE_LIST))")))
ifeq ($(QMK_USERSPACE),)
QMK_USERSPACE := $(shell pwd)
endif

QMK_FIRMWARE_ROOT = $(shell qmk config -ro user.qmk_home | cut -d= -f2 | sed -e 's@^None$$@@g')
ifeq ($(QMK_FIRMWARE_ROOT),)
$(error Cannot determine qmk_firmware location. `qmk config -ro user.qmk_home` is not set)
endif

%:
+$(MAKE) -C $(QMK_FIRMWARE_ROOT) $(MAKECMDGOALS) QMK_USERSPACE=$(QMK_USERSPACE)
32 changes: 27 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Here is a visualization of my keymap. See the [keymap.c](keymap.c) itself for
full details.

**Base layer** ([Magic
Sturdy](https://github.com/Ikcelaks/keyboard_layouts/blob/main/magic_sturdy/magic_sturdy.md) with home row mods)
Sturdy](https://getreuer.info/posts/keyboards/alt-layouts/index.html#magic-sturdy) with home row mods)

![Base layer](doc/layout_base.png)

Expand All @@ -119,13 +119,35 @@ Sturdy](https://github.com/Ikcelaks/keyboard_layouts/blob/main/magic_sturdy/magi

## License

This code uses the Apache License 2.0. See the [LICENSE file](LICENSE.txt) for
details.
This repo uses the Apache License 2.0 except where otherwise indicated. See the
[LICENSE file](LICENSE.txt) for details.


## Installation

Clone the [QMK firmware](https://github.com/qmk/qmk_firmware) and place this
repo in `qmk_firmware/keyboards/handwired/dactyl_promicro/keymaps/getreuer`.
This repo works as an [External QMK
Userspace](https://docs.qmk.fm/#/newbs_external_userspace). Instructions on how
to use it in QMK:

1. [Set up QMK](https://docs.qmk.fm/#/newbs).

2. Clone this repo locally

~~~{.sh}
git clone https://github.com/getreuer/qmk-keymap
~~~

3. Run the following shell command, replacing "`path/to/qmk-keymap`" with the
relative path to your clone of `qmk-keymap` from the previous step:

~~~{.sh}
qmk config user.overlay_dir="$(realpath path/to/qmk-keymap)"
~~~

My keymap may then be compiled and flashed with

~~~{.sh}
# Dactyl Ergodox
qmk flash -kb handwired/dactyl_promicro -km getreuer
~~~

5 changes: 1 addition & 4 deletions config.h → config_common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2023 Google LLC
// Copyright 2021-2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -14,9 +14,6 @@

#pragma once

#define USE_SERIAL
#define MASTER_RIGHT

// Unfortunately, some applications drop or misorder fast key events. This is a
// partial fix to slow down the rate at which macros are sent.
#define TAP_CODE_DELAY 12
Expand Down
114 changes: 3 additions & 111 deletions keymap.c → getreuer.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021-2023 Google LLC
// Copyright 2021-2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -34,20 +34,18 @@
*
* License
* -------
* This code uses the Apache License 2.0. See LICENSE.txt for details.
* This repo uses the Apache License 2.0 except where otherwise indicated. See
* LICENSE.txt for details.
*
* For further documentation of this keymap's features, see
* <https://getreuer.info/posts/keyboards>
*/

#include QMK_KEYBOARD_H

#include "features/achordion.h"
#include "features/custom_shift_keys.h"
#include "features/orbital_mouse.h"
#include "features/select_word.h"
#include "features/sentence_case.h"
#include "layout.h"

enum layers {
BASE,
Expand Down Expand Up @@ -159,112 +157,6 @@ enum custom_keycodes {
#define QHOME_Z LGUI_T(KC_Z)
#define QHOME_SL RGUI_T(KC_SLSH)

// clang-format off
// keymap_vis:begin
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
[BASE] = LAYOUT_LR( // Base layer: Magic Sturdy.
KC_GRV , KC_7 , KC_8 , KC_9 , KC_0 , KC_5 ,
KC_TAB , KC_V , KC_M , KC_L , KC_C , KC_P ,
KC_BSPC, HOME_S , HOME_T , HOME_R , HOME_D , KC_Y ,
KC_LSFT, HOME_X , KC_K , KC_J , KC_G , KC_W ,
KC_LCTL, KC_PGUP, KC_PGDN, KC_DOWN, KC_UP ,
MO(SYM), KC_UNDS,
KC_BSLS,
KC_DEL , KC_SPC , KC_BTN1,

KC_6 , KC_1 , KC_2 , KC_3 , KC_4 , USRNAME,
KC_B , MAGIC , KC_U , KC_O , KC_Q , KC_SLSH,
KC_F , HOME_N , HOME_E , HOME_A , HOME_I , KC_MINS,
KC_Z , KC_H , KC_COMM, KC_DOT , HOME_SC, KC_ENT ,
KC_LEFT, KC_RGHT, DASH , ARROW , HAPPY ,
KC_QUOT, TG(MOUSE),
SCOPE ,
SELWORD, QK_REP , KC_ESC
),

[QWERTY] = LAYOUT_LR( // Alternative base layer: QWERTY.
_______, _______, _______, _______, _______, _______,
_______, KC_Q , KC_W , KC_E , KC_R , KC_T ,
_______, QHOME_A, QHOME_S, QHOME_D, QHOME_F, KC_G ,
_______, QHOME_Z, KC_X , KC_C , KC_V , KC_B ,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______,

_______, _______, _______, _______, _______, _______,
KC_Y , KC_U , KC_I , KC_O , KC_P , _______,
KC_H , QHOME_J, QHOME_K, QHOME_L, QHOME_SC, _______,
KC_N , KC_M , KC_COMM, KC_DOT , QHOME_SL, _______,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______
),

[SYM] = LAYOUT_LR( // Symbol layer.
_______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F5 ,
TMUXESC, _______, KC_LABK, KC_RABK, KC_AT , KC_DOT ,
_______, KC_EXLM, KC_MINS, KC_PLUS, KC_EQL , KC_HASH,
_______, _______, KC_SLSH, KC_ASTR, KC_CIRC, SCOPE,
_______, _______, _______, C(KC_END), C(KC_HOME),
_______, _______,
_______,
SRCHSEL, _______, _______,

KC_F6 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F11 ,
KC_AMPR, _______, KC_LBRC, KC_RBRC, _______, KC_F12 ,
KC_PIPE, KC_COLN, KC_LPRN, KC_RPRN, KC_PERC, TO(ADJUST),
KC_TILD, KC_DLR , KC_LCBR, KC_RCBR, _______, _______,
KC_HOME, KC_END , _______, _______, _______,
TMUXESC, _______,
_______,
_______, _______, _______
),

[MOUSE] = LAYOUT_LR( // Mouse keys layer.
G(KC_TAB), _______, _______, _______, _______, _______,
_______, KC_MPLY, OM_BTN2, OM_U , OM_BTNS, OM_DBLS,
EXIT , KC_WBAK, OM_L , OM_D , OM_R , OM_HLDS,
_______, KC_LGUI, OM_BTN3, OM_W_D , OM_W_U , OM_RELS,
_______, _______, _______, C(KC_C), C(KC_V),
_______, _______,
_______,
_______, OM_BTNS, _______,

_______, _______, _______, _______, _______, G(KC_TAB),
OM_DBLS, OM_BTNS, OM_U , OM_BTN2, KC_MPLY, _______,
OM_HLDS, OM_L , OM_D , OM_R , KC_WBAK, EXIT ,
OM_RELS, OM_W_D , OM_W_U , OM_BTN3, KC_RGUI, _______,
_______, _______, C(KC_PGUP), C(KC_PGDN), _______,
_______, _______,
_______,
_______, OM_BTNS, _______
),

[ADJUST] = LAYOUT_LR( // Adjust layer.
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
EXIT , XXXXXXX, XXXXXXX, DF(BASE), DF(QWERTY), XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX,
XXXXXXX,
XXXXXXX, XXXXXXX, _______,

XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QK_BOOT,
XXXXXXX, KC_BRID, KC_BRIU, XXXXXXX, XXXXXXX, XXXXXXX ,
XXXXXXX, KC_MPRV, KC_MNXT, KC_MPLY, XXXXXXX, EXIT ,
XXXXXXX, KC_VOLU, KC_VOLD, KC_MUTE, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX,
XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX
),
};
// keymap_vis:end
// clang-format on

const uint32_t unicode_map[] PROGMEM = {};

const custom_shift_key_t custom_shift_keys[] = {
Expand Down
21 changes: 21 additions & 0 deletions keyboards/handwired/dactyl_promicro/keymaps/getreuer/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright 2021-2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#pragma once

#include "config_common.h"

#define USE_SERIAL
#define MASTER_RIGHT

128 changes: 128 additions & 0 deletions keyboards/handwired/dactyl_promicro/keymaps/getreuer/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// Copyright 2021-2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
* @file keymap.c
* @brief Pascal's keymap for the Dactyl Ergodox.
*/

#include QMK_KEYBOARD_H

#include "layout.h"
#include "getreuer.c"

// clang-format off
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
[BASE] = LAYOUT_LR( // Base layer: Magic Sturdy.
KC_GRV , KC_7 , KC_8 , KC_9 , KC_0 , KC_5 ,
KC_TAB , KC_V , KC_M , KC_L , KC_C , KC_P ,
KC_BSPC, HOME_S , HOME_T , HOME_R , HOME_D , KC_Y ,
KC_LSFT, HOME_X , KC_K , KC_J , KC_G , KC_W ,
KC_LCTL, KC_PGUP, KC_PGDN, KC_DOWN, KC_UP ,
MO(SYM), KC_UNDS,
KC_BSLS,
KC_DEL , KC_SPC , KC_BTN1,

KC_6 , KC_1 , KC_2 , KC_3 , KC_4 , USRNAME,
KC_B , MAGIC , KC_U , KC_O , KC_Q , KC_SLSH,
KC_F , HOME_N , HOME_E , HOME_A , HOME_I , KC_MINS,
KC_Z , KC_H , KC_COMM, KC_DOT , HOME_SC, KC_ENT ,
KC_LEFT, KC_RGHT, DASH , ARROW , HAPPY ,
KC_QUOT, TG(MOUSE),
SCOPE ,
SELWORD, QK_REP , KC_ESC
),

[QWERTY] = LAYOUT_LR( // Alternative base layer: QWERTY.
_______, _______, _______, _______, _______, _______,
_______, KC_Q , KC_W , KC_E , KC_R , KC_T ,
_______, QHOME_A, QHOME_S, QHOME_D, QHOME_F, KC_G ,
_______, QHOME_Z, KC_X , KC_C , KC_V , KC_B ,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______,

_______, _______, _______, _______, _______, _______,
KC_Y , KC_U , KC_I , KC_O , KC_P , _______,
KC_H , QHOME_J, QHOME_K, QHOME_L, QHOME_SC, _______,
KC_N , KC_M , KC_COMM, KC_DOT , QHOME_SL, _______,
_______, _______, _______, _______, _______,
_______, _______,
_______,
_______, _______, _______
),

[SYM] = LAYOUT_LR( // Symbol layer.
_______, KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F5 ,
TMUXESC, _______, KC_LABK, KC_RABK, KC_AT , KC_DOT ,
_______, KC_EXLM, KC_MINS, KC_PLUS, KC_EQL , KC_HASH,
_______, _______, KC_SLSH, KC_ASTR, KC_CIRC, SCOPE,
_______, _______, _______, C(KC_END), C(KC_HOME),
_______, _______,
_______,
SRCHSEL, _______, _______,

KC_F6 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F11 ,
KC_AMPR, _______, KC_LBRC, KC_RBRC, _______, KC_F12 ,
KC_PIPE, KC_COLN, KC_LPRN, KC_RPRN, KC_PERC, TO(ADJUST),
KC_TILD, KC_DLR , KC_LCBR, KC_RCBR, _______, _______,
KC_HOME, KC_END , _______, _______, _______,
TMUXESC, _______,
_______,
_______, _______, _______
),

[MOUSE] = LAYOUT_LR( // Mouse keys layer.
G(KC_TAB), _______, _______, _______, _______, _______,
_______, KC_MPLY, OM_BTN2, OM_U , OM_BTNS, OM_DBLS,
EXIT , KC_WBAK, OM_L , OM_D , OM_R , OM_HLDS,
_______, KC_LGUI, OM_BTN3, OM_W_D , OM_W_U , OM_RELS,
_______, _______, _______, C(KC_C), C(KC_V),
_______, _______,
_______,
_______, OM_BTNS, _______,

_______, _______, _______, _______, _______, G(KC_TAB),
OM_DBLS, OM_BTNS, OM_U , OM_BTN2, KC_MPLY, _______,
OM_HLDS, OM_L , OM_D , OM_R , KC_WBAK, EXIT ,
OM_RELS, OM_W_D , OM_W_U , OM_BTN3, KC_RGUI, _______,
_______, _______, C(KC_PGUP), C(KC_PGDN), _______,
_______, _______,
_______,
_______, OM_BTNS, _______
),

[ADJUST] = LAYOUT_LR( // Adjust layer.
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
EXIT , XXXXXXX, XXXXXXX, DF(BASE), DF(QWERTY), XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX,
XXXXXXX,
XXXXXXX, XXXXXXX, _______,

XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QK_BOOT,
XXXXXXX, KC_BRID, KC_BRIU, XXXXXXX, XXXXXXX, XXXXXXX ,
XXXXXXX, KC_MPRV, KC_MNXT, KC_MPLY, XXXXXXX, EXIT ,
XXXXXXX, KC_VOLU, KC_VOLD, KC_MUTE, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
XXXXXXX, XXXXXXX,
XXXXXXX,
XXXXXXX, XXXXXXX, XXXXXXX
),
};
// clang-format on

File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions qmk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"userspace_version": "1.0",
"build_targets": []
}

0 comments on commit d1f7520

Please sign in to comment.