### Example Initializing Display Device C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_init` within the `keyboard_post_init_kb` function. Demonstrates creating a display device handle (using a placeholder function) and then initializing it with no rotation. ```C static painter_device_t display; void keyboard_post_init_kb(void) { display = qp_make_.......; // Create the display qp_init(display, QP_ROTATION_0); // Initialise the display } ``` -------------------------------- ### Example Load Image C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Partial example showing how to declare a static image handle and load a QGF image from memory (`gfx_my_image`) during keyboard initialization. It includes a check to ensure the image was loaded successfully. ```C // Draw an image on the bottom-right of the 240x320 display on initialisation static painter_image_handle_t my_image; void keyboard_post_init_kb(void) { my_image = qp_load_image_mem(gfx_my_image); if (my_image != NULL) { ``` -------------------------------- ### Example Surface Initialization in C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Provides a complete example demonstrating the static declaration of a surface device variable and its required buffer, followed by the initialization of the surface using `qp_rgb565_make_surface` and `qp_init` within a keyboard's post-initialization function. ```C static painter_device_t my_surface; static uint8_t my_framebuffer[SURFACE_REQUIRED_BUFFER_BYTE_SIZE(240, 80, 16)]; // Allocate a buffer for a 16bpp 240x80 RGB565 display void keyboard_post_init_kb(void) { my_surface = qp_rgb565_make_surface(240, 80, my_framebuffer); qp_init(my_surface, QP_ROTATION_0); keyboard_post_init_user(); } ``` -------------------------------- ### Installing QMK CLI using pip (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli.md Provides shell commands to install the QMK CLI using Python's pip, set the optional QMK_HOME environment variable for the firmware location, and execute the `qmk setup` command to download the firmware and prepare the build environment. ```Shell python3 -m pip install qmk export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment ``` -------------------------------- ### Installing QMK CLI using Homebrew (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli.md Provides shell commands to install the QMK CLI via Homebrew, set the optional QMK_HOME environment variable, and run the `qmk setup` command to clone the firmware repository and configure the build environment. ```Shell brew install qmk/qmk/qmk export QMK_HOME='~/qmk_firmware' # Optional, set the location for `qmk_firmware` qmk setup # This will clone `qmk/qmk_firmware` and optionally set up your build environment ``` -------------------------------- ### Example: Importing KBFirmware JSON with QMK CLI - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/hand_wire.md Provides a practical example of using the qmk import-kbfirmware command with a specific file path and shows the typical output messages generated by the QMK CLI. The output confirms the import success, identifies the new keyboard directory created, and provides instructions on navigating to it and building the firmware. ```Shell $ qmk import-kbfirmware ~/Downloads/gh62.json Ψ Importing gh62.json. ⚠ Support here is basic - Consider using 'qmk new-keyboard' instead Ψ Imported a new keyboard named gh62. Ψ To start working on things, `cd` into keyboards/gh62, Ψ or open the directory in your preferred text editor. Ψ And build with qmk compile -kb gh62 -km default. ``` -------------------------------- ### Example: Run Matching C Tests (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md Illustrates using the `qmk test-c --test` option with a wildcard pattern to run multiple C unit tests whose names match the provided pattern. The example runs all tests starting with "unicode". ```Shell qmk test-c --test unicode* ``` -------------------------------- ### Installing Micronucleus Bootloader Tools (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/xiudi/xd002/readme.md These commands clone the official micronucleus repository from GitHub, navigate into the commandline utility directory, and install the micronucleus flashing tools required to communicate with the bootloader on the xd002's ATtiny85 microcontroller. ```bash git clone https://github.com/micronucleus/micronucleus.git cd micronucleus/commandline/ sudo make install ``` -------------------------------- ### Building QMK Firmware: Brick65S (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/era/sirind/brick65s/readme.md Provides the example command to build the QMK firmware for the Brick65S (Solder version) keyboard. This command should be executed in a terminal after the QMK build environment is set up. It targets the 'default' keymap. ```Shell make era/sirind/brick65s:default ``` -------------------------------- ### Example Control Display Power C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_power` within suspend/wakeup functions. Shows how to turn the display off during suspend (`suspend_power_down_user`) and back on during wakeup (`suspend_wakeup_init_user`), while also managing backlight and RGB matrix states. ```C static uint8_t last_backlight = 255; void suspend_power_down_user(void) { if (last_backlight == 255) { last_backlight = get_backlight_level(); } backlight_set(0); rgb_matrix_set_suspend_state(true); qp_power(display, false); } void suspend_wakeup_init_user(void) { qp_power(display, true); rgb_matrix_set_suspend_state(false); if (last_backlight != 255) { backlight_set(last_backlight); } last_backlight = 255; } ``` -------------------------------- ### Example Draw Rectangle C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_rect` within a throttled housekeeping task. Demonstrates drawing a series of filled 8x8 rainbow rectangles down the left side of the display, followed by flushing the updates. ```C void housekeeping_task_user(void) { static uint32_t last_draw = 0; if (timer_elapsed32(last_draw) > 33) { // Throttle to 30fps last_draw = timer_read32(); // Draw 8px-wide rainbow filled rectangles down the left side of the display for (int i = 0; i < 239; i+=8) { qp_rect(display, 0, i, 7, i+7, i, 255, 255, true); } qp_flush(display); } } ``` -------------------------------- ### Running QMK Docker Build Script Interactively (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_docker.md Starts the `util/docker_build.sh` script without any command-line arguments. The script will then prompt the user interactively to enter the keyboard and keymap parameters for the build process. ```bash util/docker_build.sh # Reads parameters as input (leave blank for all keyboards/keymaps) ``` -------------------------------- ### Installing Micronucleus Command Line Tool (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/1k/readme.md Clones the micronucleus repository from GitHub, navigates into the commandline directory, and installs the necessary tool globally on the system using `sudo make install`. This tool is required for flashing firmware to the ATtiny85 via the micronucleus bootloader. ```bash git clone https://github.com/micronucleus/micronucleus.git cd micronucleus/commandline/ sudo make install ``` -------------------------------- ### Building QMK Firmware for Keyten KT60HS-T (Default) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keyten/kt60hs_t/readme.md This command builds the QMK firmware for the keyten kt60hs_t keyboard using the 'default' keymap. It requires a properly set up QMK build environment. ```Shell make keyten/kt60hs_t:default ``` -------------------------------- ### Example: Listing Available Console Devices (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example shows how to list all detected devices that support QMK console output. This is useful for identifying the device IDs (VID:PID) of connected keyboards. ```Bash qmk console -l ``` -------------------------------- ### Flash Firmware to Anne Pro 2 using annepro2_tools Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/annepro2/readme.md This command uses the `annepro2_tools` utility to flash the specified firmware binary file (`annepro2_c15_default.bin` in this example) to the Anne Pro 2 keyboard. The keyboard must be in DFU/IAP mode. ```Bash annepro2_tools annepro2_c15_default.bin ``` -------------------------------- ### Example: Compiling QMK Firmware in Layout Directory (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example shows compiling a layout (`community/60_ansi/mechmerlin-ansi`) for a specific keyboard (`dz60`) by navigating into the layout's directory and running `qmk compile` with the keyboard name. ```Bash $ cd ~/qmk_firmware/layouts/community/60_ansi/mechmerlin-ansi $ qmk compile -kb dz60 Ψ Compiling keymap with make dz60:mechmerlin-ansi ... ``` -------------------------------- ### Converting Graphics with qmk painter-convert-graphics Example (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Provides a practical example of using the `qmk painter-convert-graphics` command to convert a GIF image to a mono16 QGF format, specifying input, output directory, and format. Shows the expected output messages indicating file generation. ```Shell $ cd /home/qmk/qmk_firmware/keyboards/my_keeb $ qmk painter-convert-graphics -f mono16 -i my_image.gif -o ./generated/ Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/my_image.qgf.h... Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/my_image.qgf.c... ``` -------------------------------- ### Generating Font Image with qmk painter-make-font-image Example (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Provides a practical example of using the `qmk painter-make-font-image` command to convert a TTF font into an intermediate PNG image. Demonstrates specifying the font file, size, output path, and including additional unicode glyphs. ```Shell $ qmk painter-make-font-image --font NotoSans-ExtraCondensedBold.ttf --size 11 -o noto11.png --unicode-glyphs "ĄȽɂɻɣɈʣ" ``` -------------------------------- ### Defining Admin Layer Layout in C Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/ckeys/handwire_101/readme.md This commented-out block visualizes the layout for the 'ADMIN' layer. It contains administrative functions such as 'QK_BOOT' for easily entering bootloader mode for flashing firmware, an example macro ('ABOUT CKEYS'), and controls ('CLICKY UP', 'CLICKY DOWN', 'CLICKY OFF', 'CLICKY ON') for manipulating simulated clicky sounds if a speaker is installed. ```C /* ADMIN * ,-----------------------------------------.n * | QK_BOOT | | | X | * |------------+-----+-----------+----------| * |ABOUT CKEYS | | | | * |------------+-----+-----------+----------| * | | |CLICKY UP |CLICKY OFF| * |------------+-----+-----------+----------| * | X | |CLICKY DOWN|CLICKY ON | * `-----------------------------------------' */ ``` -------------------------------- ### Example: Connecting to All Keyboard Consoles (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example demonstrates connecting to and displaying console messages from all keyboards currently connected to the system that have console output enabled in their firmware. ```Bash qmk console ``` -------------------------------- ### Building QMK Firmware (Makefile) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/primekb/meridian_rgb/readme.md This command builds the QMK firmware for the specified keyboard (using `primekb/meridian_rgb` as an example target as suggested by the text) with the default keymap. It compiles the source code and generates the necessary firmware file ready for flashing. ```Makefile make primekb/meridian_rgb:default ``` -------------------------------- ### Flashing QMK Firmware (Makefile) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/primekb/meridian_rgb/readme.md This command flashes the previously built QMK firmware (for the `primekb/meridian_rgb` example target with the default keymap) onto the connected keyboard. It assumes the keyboard is in bootloader mode and the flashing utility is correctly set up. ```Makefile make primekb/meridian_rgb:default:flash ``` -------------------------------- ### Building Firmware QMK Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/recompile_keys/nomu30/readme.md This command compiles the QMK firmware for the Nomu30 keyboard using the default keymap. It requires a correctly set up QMK build environment, which can be installed by following the linked build environment setup guide. The output of this command is a firmware file (typically a .hex or .uf2) ready to be flashed onto the keyboard. ```shell make recompile_keys/nomu30:default ``` -------------------------------- ### Cloning QMK Repository with Submodules (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_docker.md Clones the QMK firmware repository from GitHub, including all necessary submodules (`--recurse-submodules`), and then navigates into the newly created `qmk_firmware` directory. This is the essential first step before attempting a build. ```bash git clone --recurse-submodules https://github.com/qmk/qmk_firmware.git cd qmk_firmware ``` -------------------------------- ### Flashing QMK Firmware: Brick65S (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/era/sirind/brick65s/readme.md Provides the example command to flash the previously built QMK firmware to the Brick65S (Solder version) keyboard. This command is executed in a terminal and uses the 'default' keymap target. ```Shell make era/sirind/brick65s:default:flash ``` -------------------------------- ### Flashing LUFA Bootloader to Specific Device (/dev/sdx) on Linux Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/hhkb/yang/memo.md This command is a specific example of using `dd` to flash the `FLASH.bin` firmware file, demonstrating how to use the identified virtual block device path, such as `/dev/sdx`. The `seek=4` parameter is included to ensure the write operation starts after the initial 4 sectors, matching the bootloader's expected layout. ```Shell dd if=FLASH.bin of=/dev/sdx seek=4 ``` -------------------------------- ### Building All Keyboards and Keymaps Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_make_guide.md Example of the default `make` command behavior when run from the root directory or explicitly requested using the `all` target for both keyboard and keymap, building firmware for every supported configuration. ```Shell make all:all ``` -------------------------------- ### Flashing QMK Firmware onto bajjak Keyboard (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/bajjak/readme.md This command flashes the compiled QMK firmware for the "bajjak" keyboard (specifically the build using the "default" keymap) onto the physical device. Ensure the keyboard is connected to your computer and is in bootloader mode before running this command. This requires QMK build tools and flashing utilities to be installed. ```Shell make bajjak:default:flash ``` -------------------------------- ### Flashing QMK Firmware to Keyten KT60HS-T (Default) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keyten/kt60hs_t/readme.md This command flashes the previously built QMK firmware (using the 'default' keymap) onto the keyten kt60hs_t keyboard. Ensure the keyboard is in bootloader mode before executing this command. ```Shell make keyten/kt60hs_t:default:flash ``` -------------------------------- ### Building and Flashing QMK Firmware with Docker (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_docker.md Runs the `util/docker_build.sh` script to build the firmware for the specified keyboard and keymap, and then attempts to flash it directly to the keyboard using the `:flash` target. Note that this target does not support mass storage bootloaders. ```bash util/docker_build.sh keyboard:keymap:target # For example: util/docker_build.sh planck/rev6:default:flash ``` -------------------------------- ### Example Draw and Flush Display C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_flush` after a drawing operation (`qp_rect`). This snippet within a throttled housekeeping task demonstrates drawing a rectangle and then immediately flushing the changes to the display. ```C void housekeeping_task_user(void) { static uint32_t last_draw = 0; if (timer_elapsed32(last_draw) > 33) { // Throttle to 30fps last_draw = timer_read32(); // Draw a rect based off the current RGB color qp_rect(display, 0, 7, 0, 239, rgb_matrix_get_hue(), 255, 255); qp_flush(display); } } ``` -------------------------------- ### Flashing QMK Firmware with Makefile Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/handwired/riblee_f411/readme.md Command to flash the previously built QMK firmware (for `handwired/riblee_f411` with `default` keymap) onto the connected Blackpill F411 microcontroller. Requires the keyboard to be in bootloader mode and necessary flashing tools installed. ```Shell make handwired/riblee_f411:default:flash ``` -------------------------------- ### Example: Showing Basic Keyboard Info (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example demonstrates using `qmk info` to display fundamental information about a specific keyboard, in this case, `planck/rev5`, using the `-kb` flag. ```Bash qmk info -kb planck/rev5 ``` -------------------------------- ### Building QMK Firmware - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keychron/q1v1/readme.md Provides examples of `make` commands used to build the QMK firmware for different Keychron Q1v1 layouts (ANSI, ANSI with encoder, ISO, ISO with encoder). Requires the QMK build environment to be set up. ```Shell make keychron/q1v1/ansi:default make keychron/q1v1/ansi_encoder:default make keychron/q1v1/iso:default make keychron/q1v1/iso_encoder:default ``` -------------------------------- ### Executing QMK Make Command Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_make_guide.md Describes the general syntax for building QMK firmware using the `make` command, specifying the keyboard path, keymap, and target operation. `` is the path to the keyboard/revision, `` is the keymap name, and `` is the build operation (e.g., `all`, `flash`). ```Shell make :: ``` -------------------------------- ### Example: Run Entire C Test Suite (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md Demonstrates how to run the full QMK C unit test suite by executing the `qmk test-c` command without any arguments or options. ```Shell qmk test-c ``` -------------------------------- ### Backing Up Firmware with dfu-util (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/durgod/k3x0/readme.md This command uses `dfu-util` to read the original firmware from the connected DFU device and save it to a file. `-a 0` specifies the alternative interface, `-d 0483:DF11` targets the specific USB Vendor/Product ID for STM32 DFU, `-s 0x08000000` sets the starting address, and `-U k3x0_original.bin` is the output file. Requires `dfu-util` installed and the device in DFU mode. ```bash dfu-util -a 0 -d 0483:DF11 -s 0x08000000 -U k3x0_original.bin ``` -------------------------------- ### Building QMK Firmware - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keyspensory/kp60/readme.md Provides the shell command example to build the default firmware for the Keyspensory KP60 keyboard using the QMK build system. It assumes the build environment is already set up. ```Shell make keyspensory/kp60:default ``` -------------------------------- ### Displaying a JSON Code Block Example Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/__capabilities.md Provides an example of a code block containing a sample JSON object with nested properties and arrays, demonstrating JSON syntax rendering. ```JSON { "a": "b", "c": 4, "d": { "e": [ 0, 1, 2, 3 ] } } ``` -------------------------------- ### Example Set Single Pixel Color C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_setpixel` within a throttled housekeeping task. Demonstrates drawing a vertical rainbow line on the left edge (X=0) pixel by pixel, followed by flushing the changes. ```C void housekeeping_task_user(void) { static uint32_t last_draw = 0; if (timer_elapsed32(last_draw) > 33) { // Throttle to 30fps last_draw = timer_read32(); // Draw a 240px high vertical rainbow line on X=0: for (int i = 0; i < 239; ++i) { qp_setpixel(display, 0, i, i, 255, 255); } qp_flush(display); } } ``` -------------------------------- ### Building Keychron C1 Pro V2 Firmware (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keychron/c1_pro_v2/readme.md Provides examples of `make` commands to build QMK firmware for the Keychron C1 Pro V2 keyboard with different backlighting configurations (RGB, white, no light). Requires a QMK build environment setup. The output is a firmware file ready for flashing. ```Shell make keychron/c1_pro_v2/ansi/rgb:default ``` ```Shell make keychron/c1_pro_v2/ansi/white:default ``` ```Shell make keychron/c1_pro_v2/ansi/non_light:default ``` -------------------------------- ### Simple Docstring Example - Python Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/coding_conventions_python.md Provides a basic example of a function docstring, following the guidelines of using triple double-quotes (`"""`), starting with a short description on the first line, and including a blank line before any further detail (though none is present here). ```Python def my_awesome_function(): """Return the number of seconds since 1970 Jan 1 00:00 UTC. """ return int(time.time()) ``` -------------------------------- ### Compiling and Flashing with Options Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_make_guide.md Example combining a specific build target (`flash`) with an extra command-line option (`COLOR=false`), compiling and uploading the firmware without color output in the terminal. ```Shell make planck/rev4:default:flash COLOR=false ``` -------------------------------- ### Compiling CO60 Firmware using Make Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/handwired/co60/readme.md This command is used within the QMK build environment to compile the default firmware for the CO60 PCB, specifically for the revision 7. It requires the user to have followed the QMK build environment setup guide. ```Make make handwired/co60/rev7:default ``` -------------------------------- ### Building QMK Firmware for Helpo (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/axolstudio/helpo/readme.md This command builds the QMK firmware for the 'axolstudio/helpo' keyboard using the 'default' keymap. It requires the QMK build environment to be set up. The output is typically a `.hex` or `.bin` firmware file ready for flashing. ```Shell make axolstudio/helpo:default ``` -------------------------------- ### Example Draw Line C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_line` within a throttled housekeeping task. Demonstrates drawing multiple horizontal rainbow lines to create an 8px wide vertical rainbow bar on the left side of the display, followed by flushing. ```C void housekeeping_task_user(void) { static uint32_t last_draw = 0; if (timer_elapsed32(last_draw) > 33) { // Throttle to 30fps last_draw = timer_read32(); // Draw 8px-wide rainbow down the left side of the display for (int i = 0; i < 239; ++i) { qp_line(display, 0, i, 7, i, i, 255, 255); } qp_flush(display); } } ``` -------------------------------- ### Flashing QMK Firmware for Training Wheel 40 (Command Line) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/p3d/tw40/readme.md This command uses the QMK build system (`make`) to compile and then flash the default firmware onto the Training Wheel 40 keyboard. The keyboard must be plugged in and in bootloader/DFU mode (typically by holding the top left key while plugging in). Requires a correctly set up QMK build environment and flashing tools. ```Command Line make p3d/tw40:default:flash ``` -------------------------------- ### Example Draw Ellipse C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_ellipse` within a throttled housekeeping task. Demonstrates drawing a series of filled rainbow ellipses with dimensions 16x8 down the left side of the display, centered within 8px vertical strips, followed by flushing. ```C void housekeeping_task_user(void) { static uint32_t last_draw = 0; if (timer_elapsed32(last_draw) > 33) { // Throttle to 30fps last_draw = timer_read32(); // Draw 16x8 filled ellipses down the left side of the display for (int i = 0; i < 239; i+=8) { qp_ellipse(display, 8, 4+i, 16, 8, i, 255, 255, true); } qp_flush(display); } } ``` -------------------------------- ### Example: Run Entire Python Test Suite (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md Demonstrates running the complete suite of Python tests for QMK firmware by simply executing the `qmk pytest` command without any additional arguments. ```Shell qmk pytest ``` -------------------------------- ### Example Draw Circle C Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Example usage of `qp_circle` within a throttled housekeeping task. Demonstrates drawing a series of filled rainbow circles with radius 4 down the left side of the display, centered within 8px vertical strips, followed by flushing. ```C void housekeeping_task_user(void) { static uint32_t last_draw = 0; if (timer_elapsed32(last_draw) > 33) { // Throttle to 30fps last_draw = timer_read32(); // Draw r=4 filled circles down the left side of the display for (int i = 0; i < 239; i+=8) { qp_circle(display, 4, 4+i, 4, i, 255, 255, true); } qp_flush(display); } } ``` -------------------------------- ### Building QMK Firmware with Docker (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_docker.md Executes the `util/docker_build.sh` script to compile the specified keyboard and keymap within the Docker environment. The resulting firmware file (`.hex` or `.bin`) will be placed in the QMK directory. Omitting `:keymap` builds all keymaps for the given keyboard. ```bash util/docker_build.sh : # For example: util/docker_build.sh planck/rev6:default ``` -------------------------------- ### Flashing QMK Firmware for Pearl Keyboard (make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/pearl/readme.md This command initiates the process to flash the QMK firmware onto the Pearl 40% keyboard. It will typically build the firmware first (if not already built) and then attempt to flash it to the microcontroller. The keyboard needs to be in bootloader mode for flashing to succeed, and appropriate flashing tools must be installed and configured in the QMK environment. ```make make pearl:default:flash ``` -------------------------------- ### Building Keychron Q9 QMK Firmware (Make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keychron/q9/readme.md Provides example make commands to build the default QMK firmware for the Keychron Q9 keyboard. These commands cover different layouts (ANSI, ISO) and configurations (with or without encoder support). Requires a properly set up QMK build environment. ```shell make keychron/q9/ansi:default ``` ```shell make keychron/q9/ansi_encoder:default ``` ```shell make keychron/q9/iso:default ``` ```shell make keychron/q9/iso_enocder:default ``` -------------------------------- ### Build Default QMK Firmware for 25 Keyboard (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/40percentclub/25/readme.md This command is used to build the default QMK firmware for the 40percentclub/25 keyboard. It requires a properly set up QMK build environment. Execute this command in the root directory of your QMK firmware clone after following the build environment setup guide. ```sh make 40percentclub/25:default ``` -------------------------------- ### Building QMK Firmware for TONE using Make Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/peranekofactory/tone/readme.md This command compiles the default keymap and configuration for the TONE macro pad within the QMK firmware build system. It requires a correctly set up QMK build environment. The output is a firmware file ready for flashing. ```Shell make peranekofactory/tone:default ``` -------------------------------- ### Cloning QMK External Userspace Fork (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/newbs_external_userspace.md Commands to clone your forked QMK External Userspace repository from GitHub into your home directory and configure QMK to use it as an overlay directory. This setup is recommended for users who want to manage their keymaps via Git. Requires Git and the QMK CLI installed and in the PATH. ```Shell cd $HOME git clone https://github.com/{myusername}/qmk_userspace.git qmk config user.overlay_dir="$(realpath qmk_userspace)" ``` -------------------------------- ### Flash QMK Firmware Example (Make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/nibell/micropad4x4/readme.md This Make command is provided as an example for flashing QMK firmware. Note the potential typo 'macropad4x4' which is likely intended to be 'micropad4x4'. The actual flashing procedure might vary or require adding ':flash' depending on the bootloader and setup. This command requires a configured build and flashing environment. ```Makefile make nibell/macropad4x4:default ``` -------------------------------- ### Compile QMK Keyboard Firmware (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/ez_maker/directpins/promicro/readme.md This command compiles the QMK firmware for the specified keyboard and keymap. It requires the QMK build environment to be set up correctly. ```Shell qmk compile -kb ez_maker/directpins/promicro -km default ``` -------------------------------- ### Implementing keyboard_pre_init_user for Early Hardware Setup (C) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/custom_quantum_functions.md This C function is executed very early in the QMK startup process, even before USB initialization. It is primarily intended for low-level hardware setup, such as configuring GPIO pins. This example sets several specific pins (B0, B1, B2, B3, B4) as outputs, typically for controlling LEDs. ```C void keyboard_pre_init_user(void) { // Call the keyboard pre init code. // Set our LED pins as output gpio_set_pin_output(B0); gpio_set_pin_output(B1); gpio_set_pin_output(B2); gpio_set_pin_output(B3); gpio_set_pin_output(B4); } ``` -------------------------------- ### Building QMK Firmware - Practice 60 - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/cannonkeys/practice60/readme.md This command uses the QMK `make` utility to compile the default firmware target for the Practice 60 keyboard. It requires a correctly set up QMK build environment. The output is a firmware file ready for flashing. ```shell make cannonkeys/practice60:default ``` -------------------------------- ### Converting Font Image to QFF with qmk painter-convert-font-image Example (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/quantum_painter.md Provides a practical example of using the `qmk painter-convert-font-image` command to convert the previously generated intermediate PNG font image into a mono4 QFF format. Shows specifying the input image, format, and matching the specified unicode glyphs, along with the expected output messages. ```Shell $ cd /home/qmk/qmk_firmware/keyboards/my_keeb $ qmk painter-convert-font-image --input noto11.png -f mono4 --unicode-glyphs "ĄȽɂɻɣɈʣ" Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/noto11.qff.h... Writing /home/qmk/qmk_firmware/keyboards/my_keeb/generated/noto11.qff.c... ``` -------------------------------- ### Building QMK Firmware for Training Wheel 40 (Command Line) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/p3d/tw40/readme.md This command uses the QMK build system (`make`) to compile the default firmware for the p3d/tw40 keyboard. It requires a correctly set up QMK build environment. The output is typically a `.hex` or `.bin` file ready for flashing. ```Command Line make p3d/tw40:default ``` -------------------------------- ### Flashing QMK Firmware - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keychron/q1v1/readme.md Provides examples of `make` commands used to flash the built QMK firmware to the Keychron Q1v1 keyboard for different layouts. Requires the QMK build environment and the keyboard connected in DFU mode (or similar). ```Shell make keychron/q1v1/ansi:default:flash make keychron/q1v1/ansi_encoder:default:flash make keychron/q1v1/iso:default:flash make keychron/q1v1/iso_encoder:default:flash ``` -------------------------------- ### Passing Build Options via Make Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_make_guide.md Examples of passing various build configuration options directly on the `make` command line, allowing temporary overrides of `rules.mk` settings like turning off color output or controlling verbosity. ```Shell make COLOR=false ``` ```Shell make SILENT=true ``` ```Shell make VERBOSE=true ``` ```Shell make VERBOSE_LD_CMD=yes ``` ```Shell make VERBOSE_AS_CMD=yes ``` -------------------------------- ### Compiling AEK64 Default Firmware (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/handwired/aek64/readme.md Use this command in your QMK build environment to compile the default firmware hex file for the AEK64 keyboard. Ensure you have followed the QMK setup guide before running. ```Shell make aek64:default ``` -------------------------------- ### Building QMK Firmware for 1up pi60 RGB v2 Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/1upkeyboards/pi60_rgb_v2/readme.md Provides the necessary make command to build the default QMK firmware binary for the 1up pi60 RGB v2 keyboard. This command requires a properly set up QMK build environment. ```Shell make 1upkeyboards/pi60_rgb_v2:default ``` -------------------------------- ### Flash QMK Keyboard Firmware (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/ez_maker/directpins/promicro/readme.md This command flashes the previously compiled QMK firmware onto the connected microcontroller board. Ensure the board is in bootloader mode or ready to receive firmware. ```Shell qmk flash -kb ez_maker/directpins/promicro -km default ``` -------------------------------- ### Displaying Make Help Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_make_guide.md Command to display the help message for the `make` utility itself, providing information on its built-in options like parallel compilation (`-j`). ```Shell make --help ``` -------------------------------- ### Compiling QMK Firmware (qmk command) - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/idobao/id61/readme.md Demonstrates compiling the QMK firmware for the IDOBAO ID61 keyboard using the `qmk compile` command with the default keymap. Requires the QMK build environment setup. ```Shell qmk compile -kb idobao/id61 -km default ``` -------------------------------- ### Building Keychron Q5 Firmware (Make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keychron/q5/readme.md Provides example `make` commands to build firmware for various ANSI and ISO configurations of the Keychron Q5 keyboard with or without an encoder, within the QMK build environment. These commands compile the source code into a flashable firmware file. ```Make make keychron/q5/ansi:default ``` ```Make make keychron/q5/ansi_encoder:default ``` ```Make make keychron/q5/iso:default ``` ```Make make keychron/q5/iso_encoder:default ``` -------------------------------- ### Flashing Keychron Q5 Firmware (Make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/keychron/q5/readme.md Provides example `make` commands to flash the built firmware onto different ANSI and ISO configurations of the Keychron Q5 keyboard with or without an encoder, using the QMK flashing process. These commands require the firmware to be built first and the keyboard to be in bootloader mode. ```Make make keychron/q5/ansi:default:flash ``` ```Make make keychron/q5/ansi_encoder:default:flash ``` ```Make make keychron/q5/iso:default:flash ``` ```Make make keychron/q5/iso_encoder:default:flash ``` -------------------------------- ### Build Docker Image - Keymap Beautifier - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/ergodox_ez/util/keymap_beautifier/README.md This command builds the Docker image for the keymap beautifier script. This setup ensures all Python dependencies are correctly installed within an isolated environment. It should be run once after obtaining the script. ```Shell cd QMK_GIT_REPO_dir/keyboards/ergodox_ez/util/keymap_beautifier docker build -t keymapbeautifier:1.0 . ``` -------------------------------- ### Standard Documentation Enum Naming (C) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/contributing.md This C code snippet provides an example of standard naming conventions for enums used in QMK documentation, specifically for defining layers and keycodes. `SAFE_RANGE` is a placeholder indicating the start of custom keycodes. ```C enum my_layers { _FIRST_LAYER, _SECOND_LAYER }; enum my_keycodes { FIRST_LAYER = SAFE_RANGE, SECOND_LAYER }; ``` -------------------------------- ### Initializing Userspace Directory and Template Files Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/newbs_building_firmware_workflow.md These shell commands create the necessary directory structure and initial template files for a QMK userspace project in a personal repository. It sets up a folder for GitHub workflows, a config.h, a rules.mk, and a basic source.c file. ```Shell mkdir -p ~/qmk_keymap/.github/workflows touch ~/qmk_keymap/.github/workflows/build.yml touch ~/qmk_keymap/config.h echo "SRC += source.c" > ~/qmk_keymap/rules.mk echo "#include QMK_KEYBOARD_H" > ~/qmk_keymap/source.c ``` -------------------------------- ### Building and Flashing Georgi Firmware with DFU (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/gboards/georgi/readme.md This command compiles the default firmware for the Georgi keyboard and flashes it using the `dfu-programmer`. It requires the QMK build environment and `dfu-programmer` to be installed and the keyboard to be in reset mode before execution. ```Shell make gboards/georgi:default:dfu ``` -------------------------------- ### Building QMK Firmware (humble40) - Bash Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/eyeohdesigns/humble40/readme.md This command compiles the QMK firmware for the humble40 keyboard using the default keymap. It requires the QMK build environment to be set up. ```bash make eyeohdesigns/humble40:default ``` -------------------------------- ### Example: Converting keymap.c to JSON with Keyboard/Keymap Args (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example demonstrates converting a `keymap.c` file to `keymap.json` by specifying the keyboard (`handwired/dactyl_promicro`) and keymap (`default`) using their respective flags. ```Bash qmk c2json -km default -kb handwired/dactyl_promicro ``` -------------------------------- ### Compile AnnePro2-Tools in Release Mode Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/annepro2/readme.md This command compiles the `AnnePro2-Tools` utility using the Rust `cargo` build tool in release mode. It requires the Rust toolchain and C/C++ build tools to be installed. ```Bash cargo build --release ``` -------------------------------- ### Building QMK Firmware for Adellein Keyboard - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/nightly_boards/adellein/readme.md This command initiates the QMK firmware build process for the Nightly Boards Adellein keyboard using the `default` keymap. It compiles the firmware into a .hex or .bin file ready for flashing. Requires a correctly set up QMK build environment. ```Shell make nightly_boards/adellein:default ``` -------------------------------- ### Build and Flash Default Keymap QMK Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/reviung/reviung46/readme.md This command compiles the QMK firmware for the REVIUNG46 with the 'default' keymap and then attempts to flash it to the connected keyboard. The keyboard must be in bootloader mode and flashing tools must be installed and accessible. ```Shell make reviung46:default:flash ``` -------------------------------- ### Building QMK Firmware with Specific Runtime (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_docker.md Executes the `util/docker_build.sh` script while explicitly setting the `RUNTIME` environment variable to `podman`. This forces the script to use Podman instead of Docker, overriding the default auto-detection and preference for Docker. ```bash RUNTIME="podman" util/docker_build.sh keyboard:keymap:target ``` -------------------------------- ### Example: Showing Keymap as JSON (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example demonstrates retrieving and displaying the content of a keyboard's keymap (`default` for `clueboard/california`) in a pretty-printed JSON format using `qmk info` with the `-kb` and `-km` flags. ```Bash qmk info -kb clueboard/california -km default ``` -------------------------------- ### Template for QMK Keyboard README.md (Markdown) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/documentation_templates.md Provides a template structure for a QMK keyboard's `readme.md` file. It outlines sections for including an image, description, maintainer information, supported hardware, availability, and examples of build and flashing commands. The example uses the Planck keyboard. ```markdown # Planck ![Planck](https://i.imgur.com/q2M3uEU.jpg) A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](https://qmk.fm/planck/) * Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) * Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, Teensy 2.0 * Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): make planck/rev4:default Flashing example for this keyboard: make planck/rev4:default:flash See the [build environment setup](getting_started_build_tools) and the [make instructions](getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](newbs). ## Bootloader Enter the bootloader in 3 ways: * **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard * **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available ``` -------------------------------- ### Building GameBuddy QMK Firmware (Make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/clawsome/gamebuddy/v1_0/readme.md This command compiles the QMK firmware for the GameBuddy macropad using the default keymap. It requires the QMK build environment to be set up correctly beforehand, including the necessary toolchains and dependencies as described in the QMK documentation. ```Make make clawsome/gamebuddy:default ``` -------------------------------- ### Build GetawayVan Firmware using Make (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/esca/getawayvan_f042/readme.md This command builds the QMK firmware for the esca/getawayvan_f042 configuration using the default keymap. It requires the QMK build environment to be set up beforehand, as detailed in the QMK build environment setup guide. ```Shell make esca/getawayvan_f042:default ``` -------------------------------- ### Flashing QMK Firmware to AKB OGRN (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/akb/ogrn/readme.md This command attempts to flash the previously built default firmware onto the connected AKB OGRN keyboard. The keyboard must be in bootloader mode for this command to succeed. ```Shell make akb/ogrn:default:flash ``` -------------------------------- ### Displaying a C Code Block Example Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/__capabilities.md Illustrates a simple C language code block with a basic function definition, showcasing how multi-line code snippets are rendered with syntax highlighting. ```C int c_code(void) { return -1; } ``` -------------------------------- ### Flash QMK Firmware to Jones Keyboard Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/jones/readme.md This command compiles (if necessary) and then flashes the default QMK firmware to the connected Jones v1 keyboard. It assumes the keyboard is in bootloader mode and the QMK flashing tools are installed and configured. ```Shell make jones/v1:default:flash ``` -------------------------------- ### Passing Build Options with Parameters Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/getting_started_make_guide.md Examples of passing build options that require a parameter, such as specifying a C source file for verbose compilation, dumping macros, or dumping include paths. `` should be replaced with the actual file path. ```Shell make VERBOSE_C_CMD= ``` ```Shell make DUMP_C_MACROS= ``` ```Shell make VERBOSE_C_INCLUDE= ``` -------------------------------- ### Building QMK Firmware for PT60 Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/prototypist/pt60/readme.md Examples of make commands to compile QMK firmware for the Prototypist PT60 keyboard with various configurations (default, VIA support, default ANSI layout). Requires a properly set up QMK build environment. ```make make prototypist/pt60:default ``` ```make make prototypist/pt60:via ``` ```make make prototypist/pt60:default_ansi ``` -------------------------------- ### Building QMK Firmware for Vulcan Keyboard Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/noxary/vulcan/readme.md This command is used within the QMK build environment to compile the default firmware for the Noxary Vulcan keyboard. Ensure you have followed the setup instructions for the QMK build tools before running this command. ```Shell make noxary/vulcan:default ``` -------------------------------- ### Building QMK Firmware for FightPad Keyboard (Make) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/clawsome/fightpad/readme.md This command compiles the QMK firmware for the Clawsome FightPad keyboard using the specified keymap (default in this case). It requires the QMK build environment to be set up prior to execution. The output is a firmware file ready for flashing. ```Shell make clawsome/fightpad:default ``` -------------------------------- ### Compiling QMK Firmware (make command) - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/idobao/id61/readme.md Shows an alternative method to compile the QMK firmware for the IDOBAO ID61 using the standard `make` command with the board and keymap specified. Requires the QMK build environment setup. ```Shell make idobao/id61:default ``` -------------------------------- ### Example: Compiling QMK Firmware in Keymap Directory (Bash) Source: https://github.com/vial-kb/vial-qmk/blob/vial/docs/cli_commands.md This example demonstrates compiling the firmware for a keyboard when navigating directly into the keymap's directory (`gh60/satan/keymaps/colemak`), simply by running `qmk compile`. The CLI automatically infers the keyboard and keymap. ```Bash $ cd ~/qmk_firmware/keyboards/gh60/satan/keymaps/colemak $ qmk compile Ψ Compiling keymap with make gh60/satan:colemak ... ``` -------------------------------- ### Flashing QMK Firmware onto GHS.XLS Keyboard Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/ghs/xls/readme.md This command flashes the previously built default firmware onto the GHS.XLS keyboard. The keyboard needs to be in bootloader mode for this command to succeed. Ensure you have the necessary flashing tools installed and configured. ```shell make ghs/xls:default:flash ``` -------------------------------- ### Building QMK Firmware for AKB OGRN (Shell) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/akb/ogrn/readme.md This command compiles the default QMK firmware for the AKB OGRN keyboard. It requires the QMK build environment to be set up beforehand. The output is a firmware file ready for flashing. ```Shell make akb/ogrn:default ``` -------------------------------- ### Compiling QMK Firmware Examples (v1/Elite-C) - Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/bastardkb/tbkmini/readme.md Specific examples of the `qmk compile` command for the TBK Mini v1 board equipped with an Elite-C controller. Commands are provided for building firmware with both the 'default' keymap and the 'via' keymap for use with the VIA configurator. ```Shell qmk compile -kb bastardkb/tbkmini/v1/elitec -km default ``` ```Shell qmk compile -kb bastardkb/tbkmini/v1/elitec -km via ``` -------------------------------- ### Build QMK Firmware for HotDox Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/hotdox/readme.md This command compiles the QMK firmware for the HotDox keyboard using the `default` keymap. It must be run from the root directory of your QMK firmware repository after the build tools are installed. The output is the compiled firmware file. ```Shell make hotdox:default ``` -------------------------------- ### Building Zodiark QMK Firmware (Makefile) Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/aleblazer/zodiark/readme.md This command compiles the default firmware for the 'aleblazer/zodiark' keyboard within the QMK build environment. Ensure you have followed the build environment setup guide before running this command to generate the firmware .hex or .bin file. ```Makefile make aleblazer/zodiark:default ``` -------------------------------- ### Building QMK Firmware (Instant60) Shell Source: https://github.com/vial-kb/vial-qmk/blob/vial/keyboards/cannonkeys/instant60/readme.md This command compiles the default QMK firmware for the Instant60 keyboard. It requires the QMK build environment to be set up. Run this command in the root directory of your QMK firmware clone. ```Shell make cannonkeys/instant60:default ```