### Install Dependencies and Generate Geometry Source: https://github.com/rianadon/cosmos-keyboards/blob/main/CLAUDE.md Runs one-time setup tasks including dependency installation, protobuf compilation, and generation of part and keycap geometry. ```bash make quickstart ``` -------------------------------- ### Install Optional Dependencies and Build Docs Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/contributing.md Installs optional dependencies, creates a virtual environment, installs Python dependencies, generates keyboard images, and serves the documentation. ```bash npm install --include=optional make venv make keyboards npm run doc ``` -------------------------------- ### Install Documentation Dependencies Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/contributing.md Install the necessary Python libraries for editing and previewing documentation. This can be done globally or within a virtual environment. ```bash pip install mkdocs-material[imaging]==9.5.17 \ mkdocs-awesome-pages-plugin==2.9.2 \ mkdocs-rss-plugin==1.9.0 \ lxml==4.9.3 ``` -------------------------------- ### ZMK Build Command Example Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/pcbs/lemon-wireless.md Example command to build ZMK firmware for the Lemon Wireless board. Adjust the board name based on your PCB version. ```bash west build -b cosmos_lemon_wireless ``` -------------------------------- ### Manual Screw Insert Placement Example Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/expert.md This example shows how to manually place three screw inserts using fractional indices for precise positioning. ```plaintext [1.3, 5.6, 12.4] ``` -------------------------------- ### Automatic Screw Insert Placement Example Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/expert.md This example demonstrates how to configure the system to automatically place all four screw inserts. ```plaintext [-1, -1, -1, -1] ``` -------------------------------- ### Start Vite Development Server Source: https://github.com/rianadon/cosmos-keyboards/blob/main/CLAUDE.md Starts the Vite development server for the user-facing application, accessible at http://localhost:5173/beta. ```bash make dev ``` -------------------------------- ### Install Dependencies and Compile Protobuf Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/contributing.md Installs Node.js dependencies, creates a target directory, compiles protobuf files, generates expert mode autocompletions, and generates MX switch geometry. ```bash npm install mkdir target make make parts ``` -------------------------------- ### Flash Firmware (Local QMK Install) Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/firmware.md Commands to flash firmware for split keyboards using a local QMK installation. Use these commands to flash the left and right halves separately. ```bash qmk flash -c -kb cosmos/cosmotyl -km via -bl uf2-split-left qmk flash -c -kb cosmos/cosmotyl -km via -bl uf2-split-right ``` -------------------------------- ### Build Firmware (Docker QMK Install) Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/firmware.md Commands to build firmware for split keyboards using QMK through Docker. After building, ensure you copy the generated .uf2 file. ```bash util/docker_build.sh cosmos/cosmotyl:via:uf2-split-left util/docker_build.sh cosmos/cosmotyl:via:uf2-split-right ``` -------------------------------- ### Dockerfile for Local Documentation Build Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/contributing.md Use this Dockerfile to build a local environment for serving the documentation. It installs necessary Python packages and sets up the entrypoint and command for mkdocs. ```Dockerfile FROM squidfunk/mkdocs-material:9.5 RUN pip install mkdocs-awesome-pages-plugin==2.9.2 \ mkdocs-rss-plugin==1.9.0 \ lxml==4.9.3 ENTRYPOINT ["/sbin/tini", "--", "mkdocs"] CMD ["serve", "--dev-addr=0.0.0.0:8000"] ``` -------------------------------- ### Example of Shaper Key Usage in Cosmos Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/tips-and-tricks.md This example demonstrates the configuration of shaper keys for incorporating OLED displays, highlighting modified row and rotation Z values for precise placement. ```json CrkBChESBRCAPyAnEgASABIAODFAAAoREgUQgEsgJxIAEgASADgdQAAKHhIFEIBXICcSABIAEgMQsC8SBQgIELBfOAlAgPC8AgobEgUQgGMgJxIAEgASAxCwOxIFCAgQsGs4CkAAChUSBRCAbyAnEgASABIAOB5AgIaKwAcKLhIRCAgQECAjKB4wyAFIgICsrAESBAgRIAASDwgIIB4oHjDIAUiAgLCsAThFQAAYAEDohaCu8FVI3PCioAEKigEKKxITEMCAAkCAgJgCSMKZoJWQvAFQQxISQICAzAJIwpmglZC8AVCGAVg6OAgKFRIQEEBAgIAgSNCVgN2Q9QNQC1CeAgonEhAQQECAgPgBSOaZ/KeQC1BXEhFAgICkA0jwmcS10DBQdFiVAVB/GAIiCgjIARDIARgAIABAy4v8n9AxSK2R3I3BkwaCAQIEAg== ``` -------------------------------- ### QMK Keymap Configuration Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/qmk-rp2040.md Example keymap.c file for a 4-row, 6-column keyboard with extra keys and encoders, supporting 4 layers. Ensure the number of keys per layer matches your hardware and avoid trailing commas. ```c #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, 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_LBRC, KC_RBRC, KC_LCTL, KC_LGUI, KC_LALT, KC_ESC, QK_BOOT, KC_RALT, MO(1), KC_LEFT, KC_LBRC, KC_RBRC ), [1] = LAYOUT( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [2] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), [3] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, [1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, [2] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) }, [3] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_RIGHT, KC_LEFT) } }; ``` -------------------------------- ### Create a Sphere-Layout Keyboard Configuration Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/expert.md This example defines keyboard keys with positions calculated using `placeOnSphere` and then applies transformations. It's intended for virtual experimentation due to its unconventional layout. ```typescript // Define the letters to be placed on each row const rows = ['zxcvbnm', 'asdfghjkl', 'qwertyuiop'] const keys: Key[] = [] // Construct the keys with for loops for (let r = 0; r < rows.length; r++) { for (let i = 0; i < rows[r].length; i++) { // The key's offset from the center const center = 0.5 - (i / (rows[r].length - 1)) keys.push({ type: 'mx-better', keycap: { profile: 'xda', row: 5, letter: rows[r][i] }, cluster: 'fingers', aspect: 1, position: new Trsf() .placeOnSphere({ curvature: -15, // Play around with the curvature to make new designs! spacing: 22, angle: 0, // The rotation happens afterwards row: r + 2, }) .translate([0, 110, 0]) // Push the keys out from the center .rotate(56 * center, [0, 0, 0], [0, 0, 1]), // Span a total of 56 degrees }) } } const config = { ...options, wristRestOrigin: null, keys } export default { unibody: config } ``` -------------------------------- ### Docker Compose for Local Documentation Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/contributing.md Configure docker-compose.yml to run the mkdocs documentation locally using a Docker image. This setup maps local files and exposes the service on a specified port. ```yaml version: '3' services: mkdocs: image: your-name/mkdocs ports: - "8005:8000" volumes: - ./:/docs stdin_open: true tty: true ``` -------------------------------- ### Manual Placement After Automatic (Potentially Problematic) Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/expert.md This example automatically places three screw inserts and then manually places a fourth, which may lead to collisions and is generally not recommended. ```plaintext [-1, -1, -1, 9] ``` -------------------------------- ### Compile and Flash QMK Firmware (RP2040) Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/qmk-rp2040.md Use these commands to compile the UF2 firmware and flash it to the left or right side of a split keyboard. Ensure the microcontroller is in bootloader mode before executing. ```bash qmk flash -kb handwired/cosmotyl -km via -bl uf2-split-left # For left side qmk flash -kb handwired/cosmotyl -km via -bl uf2-split-right # For right side ``` -------------------------------- ### Discord Server Invite Spam Example Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/blog/posts/discord-spam.md Example of a Discord spam message attempting to lure users to a new server, often pinging everyone. ```html
``` -------------------------------- ### ZMK COL2ROW Example DTS Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/pcbs/lemon-wireless.md Example Device Tree Source (dtsi) for COL2ROW configuration in ZMK, showing the necessary diode direction and GPIO settings. ```dtsi #include "peamk_c2r.dtsi" / { kscan { diode-direction = "col2row"; row-gpios = <&pro_micro 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, <&pro_micro 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; }; ``` -------------------------------- ### ZMK ROW2COL Example DTS Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/pcbs/lemon-wireless.md Example Device Tree Source (dtsi) for ROW2COL configuration in ZMK, demonstrating specific GPIO settings for rows and columns. ```dtsi #include "peamk_r2c.dtsi" / { kscan { diode-direction = "col2row"; col-gpios = <&pro_micro 10 GPIO_ACTIVE_LOW>, <&pro_micro 9 GPIO_ACTIVE_LOW>, <&pro_micro 15 GPIO_ACTIVE_LOW>, <&pro_micro 14 GPIO_ACTIVE_LOW>, <&pro_micro 16 GPIO_ACTIVE_LOW>, <&pro_micro 17 GPIO_ACTIVE_LOW>, <&pro_micro 18 GPIO_ACTIVE_LOW>, <&pro_micro 19 GPIO_ACTIVE_LOW>; }; }; ``` -------------------------------- ### Via JSON Configuration File Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/qmk-rp2040.md Create this JSON file to define your keyboard's layout and properties for Via. Ensure vendorId and productId match your info.json, and adjust rows/cols accordingly. Paste your KLE data into the keymap array. ```javascript { "name": "Cosmotyl", "vendorId": "0x444D", "productId": "0x3435", "matrix": { "rows": 10, "cols": 8 }, "keycodes": [ "qmk_lighting" ], "menus": [ "qmk_rgblight" ], "layouts": { "keymap": [ # PASTE YOUR RAW DATA FROM KLE HERE ] } } ``` -------------------------------- ### QMK Full-Duplex UART Configuration Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/pcbs/lemon-wired.md Configure QMK for full-duplex UART communication on the Lemon microcontroller. This setup is recommended for optimal performance and compatibility. ```c #define SPLIT_USB_DETECT #define SERIAL_USART_FULL_DUPLEX #define SERIAL_USART_PIN_SWAP #define SERIAL_USART_TX_PIN GP0 #define SERIAL_USART_RX_PIN GP1 ``` -------------------------------- ### Discord Dropshipping Scam Example Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/blog/posts/discord-spam.md Spam message from a young individual claiming success with dropshipping and offering tips via direct message. ```html ``` -------------------------------- ### QMK rules.mk for RP2040 Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/qmk-rp2040.md Sets build options for QMK firmware, including audio, RGB lighting, bootmagic, extra keys, split keyboard support, and pointing device/encoder drivers. Adjust settings based on your keyboard's features. ```makefile # Build Options # change yes to no to disable AUDIO_SUPPORTED = no RGB_MATRIX_SUPPORTED = yes RGBLIGHT_SUPPORTED = yes BOOTMAGIC_ENABLE = yes EXTRAKEY_ENABLE = yes SPLIT_KEYBOARD = yes SERIAL_DRIVER = vendor # Trackball POINTING_DEVICE_ENABLE = yes POINTING_DEVICE_DRIVER = pmw3389 # Change to pmw3360 if you use that # Encoder ENCODER_ENABLE = yes ENCODER_MAP_ENABLE = yes ``` -------------------------------- ### Discord Fake Transaction Image Spam Example Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/blog/posts/discord-spam.md Spam message featuring an image that purports to show a successful financial transaction, often with celebrity endorsements. ```html ``` -------------------------------- ### QMK Local Build Directory Structure Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/firmware.md Illustrates the expected directory structure for custom keyboard firmware within the QMK build environment. Ensure your configuration files are placed correctly under the keyboards directory. ```text keyboards/cosmos └── cosmotyl ├── config.h ├── keyboard.json ├── keymaps │ ├── default │ │ └── keymap.c │ └── via │ ├── keymap.c │ └── rules.mk ├── rules.mk └── vik... ``` -------------------------------- ### Configure ZMK Build for Cirque Trackpad Source: https://github.com/rianadon/cosmos-keyboards/blob/main/docs/docs/pcbs/lemon-wireless.md Add this to your `build.yml` to include the VIK module for a Cirque trackpad. Ensure the board and shield names are correct for your setup. ```yaml --- include: - board: cosmos_lemon_wireless # or cosmos_lemon_wireless_v4 shield: