Commit fa81493

bryfry <bryon@fryer.io>
2024-06-24 01:06:46
qmk init
1 parent 32f0351
Changed files (5)
files
bashrc_d
qmk
keyboards
gmmk
pro
rev2
ansi
keymaps
files/bashrc_d/qmk.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+alias qmk=${HOME}/.local/qmk/venv/bin/qmk
qmk/keyboards/gmmk/pro/rev2/ansi/keymaps/kernel/keymap.c
@@ -0,0 +1,91 @@
+#include QMK_KEYBOARD_H
+
+// clang-format off
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+     /* Visual keys
+     *
+     * ,--------------------------------------------------------------------------------------------------------------.
+     * | Esc  ||  F1  |  F2  |  F3  |  F4  ||  F5  |  F6  |  F7  |  F8  ||  F9  | F10  | F11  | F12  || Any  || Mouse |
+     * |==============================================================================================================|
+     * |  ` ~ |  1 ! |  2 @ |  3 # |  4 $ |  5 % |  6 ^ |  7 & |  8 * |  9 ( |  0 ) |  - _ |  = + |  Backspc || Home  |
+     * |------+------+------+------+------+------+------+------+------+------+------+------+------+----------++-------|
+     * |   Tab   |  Q   |  W   |  E   |  R   |  T   |  Y   |  U   |  I   |  O   |  P   | [ }  | ] }  |  \ |  || PgUp  |
+     * |---------+------+------+------+------+------+------+------+------+------+------+------+------+-------++-------|
+     * |  Control   |  A   |  S   |  D   |  F  |  G   |  H   |  J   |  K   |  L   | ; :  | ' "  |    Enter   || PgDn  |
+     * |------------+------+------+------+-----+------+------+------+------+------+------+------|----+========+-------|
+     * |    LShift    |  Z   |  X   |  C   |  V   |  B   |  N   |  M   | , <  | . >  | / ?  | RShift ||      || End   |
+     * |--------------+------+------+------+------+------+------+------+------+------+------+--+=====++------++=======|
+     * |  Fn    |   Win  |  LAlt  |               Space                  | RAlt |  Fn  | Ctrl ||      |      |        |
+     * `--------------------------------------------------------------------------------------------------------------'
+     */
+
+    // The FN key by default maps to a momentary toggle to layer 1 to provide access to the QK_BOOT key (to put the board into bootloader mode). Without
+    // this mapping, you have to open the case to hit the button on the bottom of the PCB (near the USB cable attachment) while plugging in the USB
+    // cable to get the board into bootloader mode - definitely not fun when you're working on your QMK builds. Remove this and put it back to KC_RGUI
+    // if that's your preference.
+    //
+    // To put the keyboard in bootloader mode, use FN+backslash. If you accidentally put it into bootloader, you can just unplug the USB cable and
+    // it'll be back to normal when you plug it back in.
+    //
+    // This keyboard defaults to 6KRO instead of NKRO for compatibility reasons (some KVMs and BIOSes are incompatible with NKRO).
+    // Since this is, among other things, a "gaming" keyboard, a key combination to enable NKRO on the fly is provided for convenience.
+    // Press Fn+N to toggle between 6KRO and NKRO. This setting is persisted to the EEPROM and thus persists between restarts.
+    [0] = LAYOUT(
+        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_MS_BTN1,
+        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_DEL,
+        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_PGUP,
+        KC_LCTL, 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_PGDN,
+        KC_LSFT,          KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,    KC_N,    KC_M,    KC_COMM, KC_DOT,  KC_SLSH,          KC_RSFT, _______, KC_END,
+        MO(1),   KC_LGUI, KC_LALT,                            KC_SPC,                             KC_RALT, MO(1),   KC_RCTL, _______, _______, _______
+    ),
+
+    /* FN1 Layout TODO FINISH
+     *
+     * ,-------------------------------------------------------------------------------------------------------------.
+     * | Esc  ||MyCmp |WbHom | Calc |MdSel ||MdPrv |MdNxt |MdPly |MdStp ||VolDn |VolUp |PrScr |ScrLk ||Pause ||RMouse|
+     * |=============================================================================================================|
+     * | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ________ ||RGBTOG|
+     * |------+------+------+------+------+------+------+------+------+------+------+------+------+----------++------|
+     * |  ______ | ____ |______|______| ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |QK_BOOT|| Home |
+     * |---------+------+------+------+------+------+------+------+------+------+------+------+------+-------++------|
+     * |  Capslock  |RGBHUD|RGBVAD|RGBHUI| ____|GMAIL |HTMAIL| ____ | ____ | ____ | ____ | ____ | __________ || End  |
+     * |------------+------+------+------+-----+------+------+------+------+------+------+------|----+========+------|
+     * |  __________  |RGBNIT| ____ | ____ | ____ | ____ |NumLk | ____ | ____ |DOTCOM| CAD  | ______ ||RGBMOD|| ____ |
+     * |--------------+------+------+------+------+------+------+------+------+------+------+--+=====++------++======|
+     * |  ____  | WinKyLk |  ____  |               _____                  | ____ | ____ | ____ ||RGBSPD|RGBRMD|RGBSPI|
+     * `------------------------------------------------------------------------------------------------------------'
+     */
+
+    // Notes:
+    // - arrow keys, where we're going we don't need arrow keys
+    // - left ctrl location is Fn
+    // - caps lock is left ctrl
+    // - Rotoary encoder = mouse
+    // Layer 1:
+    //   - fn default: left ctrl + lower (transparent)
+    //   - fn+h,j,k,l = arrows
+    //   - fn+\ = QK boot
+    //   - fn+backspace = del
+
+    [1] = LAYOUT(
+        C(KC_ESC),  C(KC_F1),   C(KC_F2),   C(KC_F3),   C(KC_F4),   C(KC_F5),   C(KC_F6),   C(KC_F7),   C(KC_F8),   C(KC_F9),   C(KC_F10),  C(KC_F11),  C(KC_F12),  C(KC_INS),              C(KC_MS_BTN1),
+        C(KC_GRV),  C(KC_1),    C(KC_2),    C(KC_3),    C(KC_4),    C(KC_5),    C(KC_6),    C(KC_7),    C(KC_8),    C(KC_9),    C(KC_0),    C(KC_MINS), C(KC_EQL),  KC_DEL,                 C(KC_DEL),
+        C(KC_TAB),  C(KC_Q),    C(KC_W),    C(KC_E),    C(KC_R),    C(KC_T),    C(KC_Y),    C(KC_U),    C(KC_I),    C(KC_O),    C(KC_P),    C(KC_LBRC), C(KC_RBRC), QK_BOOT,                C(KC_PGUP),
+        C(KC_LCTL), C(KC_A),    C(KC_S),    C(KC_D),    C(KC_F),    C(KC_G),    KC_LEFT,    KC_DOWN,    KC_UP,      KC_RGHT,    C(KC_SCLN), C(KC_QUOT),             C(KC_ENT),              C(KC_PGDN),
+        C(KC_LSFT),             C(KC_Z),    C(KC_X),    C(KC_C),    C(KC_V),    C(KC_B),    C(KC_N),    C(KC_M),    C(KC_COMM), C(KC_DOT),  C(KC_SLSH),             C(KC_RSFT), _______,    C(KC_END),
+        _______,    C(KC_LGUI), C(KC_LALT),                                     C(KC_SPC),                                      C(KC_RALT), _______,    C(KC_RCTL), _______,    _______,    _______
+    ),
+
+
+};
+// clang-format on
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
+    // Layer 0 rotary encoder left / right = mouse down, mouse up
+    [0] = { ENCODER_CCW_CW(KC_MS_D, KC_MS_U) },
+    // Layer 1 rotary encoder left / right = mouse left, mouse right
+    [1] = { ENCODER_CCW_CW(KC_MS_L, KC_MS_R) }
+};
+#endif
qmk/keyboards/gmmk/pro/rev2/ansi/keymaps/kernel/rules.mk
@@ -0,0 +1,1 @@
+ENCODER_MAP_ENABLE = yes
\ No newline at end of file
qmk/qmk.yml
@@ -0,0 +1,78 @@
+
+--- 
+- name: mf qmk.yml
+  hosts: localhost
+  gather_facts: True
+  vars: 
+    install_dir: "{{ ansible_env.HOME }}/.local/qmk"
+  tasks:
+
+   - name: apt update cache
+     apt: 
+       update_cache: True
+       cache_valid_time: 1800 #30m
+     become: True
+
+   - name: qmk - apt install tools
+     apt: 
+       update_cache: True
+       cache_valid_time: 1800 #30m
+       state: latest
+       pkg:
+         - python3-pip
+         - clang-format-14
+         - libclang-cpp14
+         - libftdi1
+         - libhidapi-libusb0
+         - libllvm14
+         - libnewlib-dev
+         - libstdc++-arm-none-eabi-dev
+         - libstdc++-arm-none-eabi-newlib
+         - libusb-0.1-4
+         - avr-libc
+         - avrdude
+         - binutils-arm-none-eabi
+         - binutils-avr
+         - clang-format
+         - clang-format-14
+         - dfu-programmer
+         - dfu-util
+         - gcc-arm-none-eabi
+         - gcc-avr
+         - libclang-cpp14
+         - libftdi1
+         - libhidapi-hidraw0
+         - libhidapi-libusb0
+         - libllvm14
+         - libnewlib-arm-none-eabi
+         - libnewlib-dev
+         - libstdc++-arm-none-eabi-dev
+         - libstdc++-arm-none-eabi-newlib
+         - libusb-0.1-4
+         - libusb-dev
+         - teensy-loader-cli
+         - wget
+         - zip
+         # wb32-dfu-updater
+         - cmake
+         - libudev-dev
+     become: True
+
+   - name: qmk - python3 + venv + qmk
+     pip: 
+       name: qmk
+       virtualenv: "{{ install_dir }}/venv"
+       virtualenv_command: "python3 -m venv"
+
+   - name: qmk - setup
+     command:
+       argv: 
+        - "{{ install_dir }}/venv/bin/qmk"
+        - "setup"
+        - "--home={{ install_dir }}/qmk_firmware"
+        - "--yes"
+       creates: "{{ install_dir }}/qmk_firmware"
+
+ # TODO 
+ # git clone https://github.com/WestberryTech/wb32-dfu-updater.git
+
qmk/README.md
@@ -0,0 +1,15 @@
+
+
+# GMMK Pro
+
+## Software:
+
+- [qmk_firmware](https://github.com/qmk/qmk_firmware)
+- [wb32-dfu-updater_cli](https://github.com/WestberryTech/wb32-dfu-updater) 
+
+## Good links:
+
+- [QMK Install & Keymap Guide for GMMK on Ubuntu distros](https://gloriousforum.com/t/qmk-install-keymap-guide-for-gmmk-2-compact-on-ubuntu-distros/14529)
+- [GMMK Pro Reverting to default firmware](https://glorious.ladesk.com/385785-GMMK-PRO---Reverting-to-default-Glorious-CORE-Firmware)
+- [GMMK Disassemble video](https://www.youtube.com/watch?v=3PvnXww9Pw4)
+