diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e45ebd3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM edasque/qmk_firmware + +RUN apt-get update +RUN apt-get install gcc-arm* diff --git a/ergodox-infinity/Makefile b/ergodox-infinity/Makefile index b0f941f..e3deb71 100644 --- a/ergodox-infinity/Makefile +++ b/ergodox-infinity/Makefile @@ -1,37 +1,33 @@ -# Check that given variables are set and all have non-empty values, -# die with an error otherwise. -# -# Params: -# 1. Variable name(s) to test. -# 2. (optional) Error message to print. -check_defined = \ - $(strip $(foreach 1,$1, \ - $(call __check_defined,$1,$(strip $(value 2))))) -__check_defined = \ - $(if $(value $1),, \ - $(error Undefined $1$(if $2, ($2)))) +QMK_REPO_DIR ?= ${HOME}/.local/share/qmk_firmware +KB_DIR ?= ${QMK_REPO_DIR}/keyboards/ergodox_infinity/keymaps/lytedev -$(call check_defined, QMK_DIR) +default: flash-left-then-right -KEYMAP_NAME = "lytedev" -ERGODOX_DIR = "${QMK_DIR}/keyboards/ergodox" -MY_KEYMAP_DIR = "${ERGODOX_DIR}/keymaps/${KEYMAP_NAME}" -MAKE_DIR = "${ERGODOX_DIR}" +${QMK_REPO_DIR}: + @git clone https://github.com/lytedev/qmk_firmware.git "${QMK_REPO_DIR}" + @cd "${QMK_REPO_DIR}" && make git-submodule -left: prep - @make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}" +repo_keymap_files: + @rm -rf "${KB_DIR}" + @mkdir -p "${KB_DIR}" + @cp keymap.c "${KB_DIR}/" -right: prep - @make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}" MASTER=right +flash-left: ${QMK_REPO_DIR} repo_keymap_files + @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev:dfu-util -dfu-left: - @make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}"-dfu-util +flash-right: ${QMK_REPO_DIR} repo_keymap_files + @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev:dfu-util MASTER=right -dfu-right: - @make -C "${MAKE_DIR}" infinity-"${KEYMAP_NAME}"-dfu-util MASTER=right +build-and-flash-left: ${QMK_REPO_DIR} repo_keymap_files + @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev -prep: - @rm -rf "${MY_KEYMAP_DIR}" - @mkdir -p "${MY_KEYMAP_DIR}" - @cp keymap.c "${MY_KEYMAP_DIR}/keymap.c" +build-and-flash-right: ${QMK_REPO_DIR} repo_keymap_files + @cd "${QMK_REPO_DIR}" && sudo make ergodox_infinity:lytedev MASTER=right +flash-left-then-right: flash-left flash-right + +build-left: ${QMK_REPO_DIR} repo_keymap_files + @docker run -e keymap=lytedev -e keyboard=ergodox_infinity --rm -v "${QMK_REPO_DIR}":/qmk:rw edasque/qmk_firmware + +build-right: ${QMK_REPO_DIR} repo_keymap_files + @docker run -e keymap=lytedev -e MASTER=right -e keyboard=ergodox_infinity --rm -v "${QMK_REPO_DIR}":/qmk:rw edasque/qmk_firmware diff --git a/ergodox-infinity/keymap.c b/ergodox-infinity/keymap.c index 13a48be..236d88a 100644 --- a/ergodox-infinity/keymap.c +++ b/ergodox-infinity/keymap.c @@ -1,4 +1,4 @@ -#include "ergodox.h" +#include QMK_KEYBOARD_H #include "debug.h" #include "action_layer.h" #include "version.h" @@ -8,6 +8,8 @@ #define SYM2 2 // symbols 2 #define MOUS 3 // mouse +#define ESC_CTL LCTL_T(KC_ESC) + enum custom_keycodes { PLACEHOLDER = SAFE_RANGE, // can always be here EPRM, @@ -24,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | Back | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Escape | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |Esc/Ctl | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| * | LShift | Z | X | C | V | B | | | | N | M | , | . | / | Enter | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -43,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Hand KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F11, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, /* ^^ */ + ESC_CTL, KC_A, KC_S, KC_D, KC_F, KC_G, /* ^^ */ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LPRN, KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, MO(SYM2), @@ -72,7 +74,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | ` | 1 | 2 | 3 | 4 | 5 | { | | } | 6 | 7 | 8 | 9 | 0 | Del | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ | + * |Esc/Ctl | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | - | = | [ | ] | \ | * |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------| * | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | , | . | / | Enter | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -91,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Hand KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_F11, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCBR, - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */ + ESC_CTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */ KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LABK, KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, @@ -120,11 +122,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| * | ~ | ! | @ | # | $ | % | { | | } | ^ | & | * | ( | ) | Back | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Escape | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | _ | + | { | } | | | + * |Esc/Ctl | F1 | F2 | F3 | F4 | F5 |------| |------| F6 | _ | + | { | } | | | * |--------+------+------+------+------+------| < | | > |------+------+------+------+------+--------| * | LShift | F7 | F8 | F9 | F10 | F11 | | | | F12 | Ins | < | > | / | Enter | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | Ctrl | Ctrl | Alt | Meta | () | | () | Left | PgDn | PgUp | Right | + * | Ctrl | Ctrl | Alt | Meta | () | | () | Home | PgDn | PgUp | End | * `----------------------------------' `------------------------------------' * ,-------------. ,-------------. * | Vol- | Menu | | Ins | Vol+ | @@ -139,7 +141,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Hand KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LCBR, - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */ + ESC_CTL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, /* ^^ */ KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_LABK, KC_LCTL, KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, @@ -153,7 +155,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RCBR, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, /* ^^ */ KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSLS, KC_RABK, KC_F12, KC_INS, KC_LABK, KC_RABK, KC_QUES, KC_ENT, - KC_TRNS, KC_LEFT, KC_PGDN, KC_PGUP, KC_RGHT, + KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, // Thumb Cluster KC_INS, KC_VOLU, diff --git a/ergodox-infinity/readme.md b/ergodox-infinity/readme.md index 7e0b6d4..a82effe 100644 --- a/ergodox-infinity/readme.md +++ b/ergodox-infinity/readme.md @@ -1,42 +1,30 @@ -# Infinity Ergodox +# Ergodox Infinity +================== This contains my `qmk_firmware`-compatible Infinity Ergodox keymap. +## Dependencies +=============== + +* Docker +* `arm-none-eabi-gcc` and `arm-none-eabi-newlib` +* See the `qmk_firmware` repo for details. ## Flashing +=========== -* Clone and setup the repository at - https://github.com/jackhumbert/qmk_firmware.git - pay special attention to the - dependencies (for arch users, `pacman -S avr-libc avr-gcc` and `dfu-programmer` - in the AUR) +Run `make flash-left` to build the firmware and flash the left hand. +`s/left/right` for the right hand. -* Run the following command, setting `QMK_DIR` to the directory of the repo you - cloned in the last step: +**Note**: You may need to run the commands as root. - export QMK_DIR="$HOME/qmk_firmware" - make left - -* Put the **left** hand of the ErgoDox in flashing mode -* In the same terminal (so that `QMK_DIR` is set) run: - - make dfu-left - -* Repeat the previous commands replacing "`left`" with "`right`" - -**Note**: You may need to run the `make dfu-left` and `make dfu-right` commands -as root. In this case, use `sudo -E make dfu-{left,right}` so that you preserve -the `QMK_DIR` environment variable you set previously. - -**Tip**: If you don't have an extra keyboard to send the `make dfu` command, -just prepend `sleep 10 &&` to it to give yourself 10 seconds to hit the flash -button. - -That should be it! Your Ergodox keyboard should now be flashed with this layout. +**Tip**: If you don't have an extra keyboard to send the command, just prepend +`sleep 10 &&` to it to give yourself 10 seconds to hit the flash button. +That should be it! Your Ergodox Infinity keyboard should now be flashed with +this layout. ## Modifying +============ Just modify `keymap.c` and repeat the steps above for flashing! Easy. - - -[ergodox_configurator]: https://input.club/configurator-ergodox diff --git a/planck/readme.md b/planck/readme.md index 49eda18..ccfe4d8 100644 --- a/planck/readme.md +++ b/planck/readme.md @@ -7,11 +7,12 @@ This contains my `qmk_firmware`-compatible Planck keymap. =============== * Docker +* See the `qmk_firmware` repo for details. ## Flashing =========== -`make dfu` +Just run `make`. Don't forget to press the flash button on your keyboard!