Files
mxandClaude Opus 5.5 806f59d6f8 Keymap: give combos their own tab
Combos move from a chip row under every layer to a Combos tab after the
layers. Each result sits on the seam between its two keys, with a dashed
line for keys far apart; pointing at a key keeps only its combos bright and
spells them out. C opens the tab.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 15:16:18 +01:00

76 lines
3.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Keymap Cheat Sheet
A keyboard button in the bar that opens a cheat sheet of your keyboard's layers,
drawn from the keymap in a git repository (default: `xnmrph/corne`). Push a
change to the keymap and the sheet redraws by itself; the bar icon lights up
until you look at it.
- **Overview** shows the base layer in the middle of each key and four more
layers in its corners, each in its own colour (the little key in each tab
shows which corner). The colours follow the theme accent.
- **A layer tab** shows that layer on its own. Keys that fall through to the
base layer are dimmed, the key you are holding to get there says *held*, and
keys that switch layers take that layer's colour. Pointing at a tab
previews it.
- **Combos** get their own tab after the layers, so they don't clutter the
others: each result is drawn on the seam between the two keys you press
(keys far apart get a dashed line). Pointing at a key keeps only its combos
bright and spells them out underneath. Layers you reach by holding two
layers (ZMK conditional layers) are listed there too.
Keys while it is open: arrow keys / Tab (or H/L) switch layers, `0` is the
overview, `1`–`9` pick a layer, `C` opens the Combos tab, `R` checks the repo now, Esc closes.
Right-clicking the bar icon also checks the repo.
## Where the keymap comes from
Settings (Settings → Bar → Keymap):
| Setting | |
| --- | --- |
| Keymap repository | `owner/name` on GitHub, or any git URL / local path. Private repos use your git credentials. |
| Branch | Blank: the default branch. |
| Keymap file | Blank: found automatically. |
| Check for changes every | Minutes between checks (default 2). It also checks when you open the sheet. |
| Opens on | Overview or the base layer. |
The file is found in this order:
1. **keymap-drawer YAML** (`keymap parse` output). With several, the one with
the most layers wins, so `corne-layers.yaml` beats the merged `corne.yaml`.
Its legends are already pretty, so this is the best source.
2. **ZMK `.keymap`**, parsed directly (`&kp`, `&mo`, `&lt`, `&mt`, `&bt`,
mouse keys, combos, conditional layers; other behaviours show their name).
3. **QMK `keymap.json`**.
The physical layout is drawn from the key count: 42 and 36 keys as a Corne
(3×6+3 / 3×5+3), 34 and 40 as split boards with two thumb keys; anything else
as a plain grid.
## How it watches the repo
A check is a `git ls-remote` (no GitHub API, so no rate limit). Only a new
commit fetches: the repo is kept as a shallow clone in
`~/.cache/glassMxrph/keymap/`, together with the last parsed sheet, so the
sheet shows at once after a restart and while offline.
When the newest commit changed the `.keymap` but not the keymap-drawer YAML,
and a workflow in the repo redraws it (like `xnmrph/corne`'s `draw.yml`), the
sheet says it is waiting for the redraw and checks every 20 seconds until the
new YAML lands.
## IPC
```sh
quickshell ipc --path <shell> call keymap toggle
quickshell ipc --path <shell> call keymap layer Symbols # open on a layer ("overview" too)
quickshell ipc --path <shell> call keymap refresh
quickshell ipc --path <shell> call keymap status
```
With glassMxrph: `glassmxrph plugin toggle mx-keymap`.
## Tests
`python3 tests/keymap_test.py`