Skip to content

Instantly share code, notes, and snippets.

View caksoylar's full-sized avatar

Cem Aksoylar caksoylar

View GitHub Profile
@caksoylar
caksoylar / dt_layout_viz.py
Last active April 25, 2024 07:05
ZMK studio proposed physical layout definition visualizer
"""
Parse a DTS file containing ZMK Studio style physical layout definitions,
then output both a QMK-style json file containing all layouts and an SVG for each defined layout.
Requires latest `keymap-drawer` package:
pip install keymap-drawer@git+https://github.com/caksoylar/keymap-drawer.git
Then run with these args:
@caksoylar
caksoylar / ram_report.txt
Created July 10, 2023 04:12
Zen ram_report
Path Size %
==============================================================================================================
Root 140225 100.00%
├── (hidden) 5549 3.96%
├── (no paths) 6700 4.78%
│ ├── CSWTCH.110 12 0.01%
│ ├── CSWTCH.11295 24 0.02%
│ ├── CSWTCH.11562 15 0.01%
│ ├── CSWTCH.11564 9 0.01%
│ ├── CSWTCH.11567
@caksoylar
caksoylar / zen-display-improvements.md
Last active April 12, 2024 09:33
Corne-ish Zen display improvements

Display improvements for the Corne-ish Zen keyboard

This note details the changes made to the Zen and ZMK codebase to improve the experience of e-ink displays.

Getting the changes

You can test out below changes using your Zen config repo by modifying your config/west.yml file, following ZMK instructions:

manifest:
  remotes:
 - name: caksoylar
@caksoylar
caksoylar / bt-icon.md
Created May 7, 2022 20:25
A patch to replace ZMK Wifi icon with the Bluetooth one

Replacing ZMK wireless connectivity indicator with BT icon

This patch replaces the Wifi icon in ZMK's default output status widget with a Bluetooth icon. This icon was created from scratch to work with the 16 pt font that ZMK uses by default for showing output status.

128x64 OLED with BT icon

Note that while LVGL font ZMK uses includes a Bluetooth icon, it doesn't render well in 16 pt font which is why we display this icon as an image instead.

@caksoylar
caksoylar / hide-momentary-layers.md
Last active July 14, 2022 04:06
A patch to disable layer widget updates for temporary layer changes

Hiding momentarily activated layers for Corne-ish Zen

This patch lets you set a config option such that the layer widget on the e-ink display of Corne-ish Zen won't update when you switch to/from layers that are activated momentarily, for instance when using &mo or &lt behaviors. The layer widget will only update for layers that are activated "permanently", i.e. using behaviors like &to or &tog. This reduces the amount of refreshes the e-ink display has to make during normal typing.

To use this feature, you can apply the patch to your ZMK repo on top of the Board-Corne-ish-Zen-dedicated-work-queue branch then enable the feature by adding CONFIG_ZMK_DISPLAY_HIDE_MOMENTARY_LAYERS=y to your corne-ish_zen.conf file.

@caksoylar
caksoylar / combination.md
Last active January 11, 2024 00:43
QMK combination dial lock for entering passwords with a rotary encoder

Creating a combination dial lock with a rotary encoder in QMK

Below is a snippet for implementing a combination dial-like mechanism you can use in your QMK keymap. This is useful for entering long passwords using a rotary encoder, or activating secret macros etc. The algorithm looks for a sequence of clockwise (CW) or counter-clockwise (CCW) turns of the rotary encoder for a certain number of ticks/clicks. It executes the macro if all turns are successfully completed, or resets to the beginning if a turn is too long or too short.

For this example we will output a string as a macro, like entering a password. In this case it is "TA DA!":

void emit_passphrase_secret(void) {