Skip to content

keybind-cheatsheet: modifier labels, numbered-run merging, named mouse buttons, string-safe comments - #903

Merged
ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
drshade:keybind-cheatsheet/labels-merge-mouse
Oct 6, 2026
Merged

ItsLemmy merged 1 commit into
noctalia-dev:mainfrom
drshade:keybind-cheatsheet/labels-merge-mouse

Conversation

@drshade

@drshade drshade commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Plugin

  • Id: kenn/keybind-cheatsheet
  • New plugin
  • Update to an existing plugin (version bumped in plugin.toml)

What it does

A few features which I relied on in the legacy-v4 cheatsheet:

  • modifier_labels (string_map setting): display names for modifiers by the compositor's name, e.g. { MOD3 = "Hyper" } for a Caps-as-Hyper setup. Unset modifiers keep the current "Super" / capitalised form.
  • merge_sequential (bool, default on): a run of sibling binds that differ only by a number — same modifiers and category, descriptions equal once digits are normalised, keys all digits or all F-keys — renders as one row ("Focus workspace N" on 1-0, "Focus display N" on F1-F3; the number row orders 1..9,0). Off in edit mode and for binds with a custom description.
  • Pointer buttons by name: Hyprland reports evdev codes, so LMB/RMB/MMB and the side/back/forward buttons replace "Mouse 272".
  • Lua scanning: a -- inside a string literal is not a comment. Any bind whose command carries a flag (exec_cmd("tool --flag")) used to lose its description before it was read and fall under "Other"; a small walker now skips -- inside quotes. New Lua fixture + expected category cover it.

External dependencies

None

Testing

  • Tested on Niri
  • Tested on Hyprland
  • Tested on Sway
  • Tested on another compositor:
  • Noctalia version tested against:
  • Plugin API level:

Screenshots / Videos

screenshot_20261002_214151-annotated

Checklist

Ready-for-review requirement: Every box in this section must be checked. If any statement is not true, keep the
pull request as Draft. An explanation does not replace a required check.

  • The directory name matches the part of id after the / in plugin.toml exactly.
  • It ships plugin.toml, README.md, thumbnail.webp, and translations/en.json.
  • README.md follows the
    README template, documents
    every entry id and dependency, and includes exact panel IPC commands and launcher prefixes where applicable.
  • thumbnail.webp is present and relevant; for a new plugin I created it with the thumbnail generator, and for an update I regenerated it with the generator if the visual identity or user-facing appearance changed.
  • version follows semver and is bumped in this PR; plugin_api is the oldest API level this plugin requires.
  • Every non-English translation in this PR uses a locale supported by Noctalia core, and I can read, write, and
    understand that language well enough to review and maintain it (no unreviewed machine/LLM translations).
  • I did not edit catalog.toml; CI generates it.
  • This PR touches exactly one plugin directory.

Code review attestation

Plugins run as trusted, unsandboxed Luau in the user's session. Confirm:
Ready-for-review requirement: Every attestation below must be checked.

  • The code is readable and not obfuscated, minified, or generated.
  • It does not download and execute remote code.
  • Every network call, filesystem write, and spawned process is something the description above accounts for.
  • I have the right to publish this code under the license declared in plugin.toml.

@Noctalia-CI

Copy link
Copy Markdown
Contributor

CC @cheerfulScumbag: this pull request was automatically moved to draft until you have had a chance to look at it. It will be marked ready for review automatically once you reply here.

…e buttons, string-safe comments

Four generic improvements to the Hyprland experience, 0.2.8 -> 0.3.0:

- `modifier_labels` (string_map setting): display names for modifiers by
  the compositor's name, e.g. { MOD3 = "Hyper" } for a Caps-as-Hyper setup.
  Unset modifiers keep the current "Super" / capitalised form.
- `merge_sequential` (bool, default on): a run of sibling binds that differ
  only by a number — same modifiers and category, descriptions equal once
  digits are normalised, keys all digits or all F-keys — renders as one row
  ("Focus workspace N" on 1-0, "Focus display N" on F1-F3; the number row
  orders 1..9,0). Off in edit mode and for binds with a custom description.
- Pointer buttons by name: Hyprland reports evdev codes, so LMB/RMB/MMB and
  the side/back/forward buttons replace "Mouse 272".
- Lua scanning: a `--` inside a string literal is not a comment. Any bind
  whose command carries a flag (`exec_cmd("tool --flag")`) used to lose its
  description before it was read and fall under "Other"; a small walker
  now skips `--` inside quotes. New Lua fixture + expected category cover it.
@drshade
drshade force-pushed the keybind-cheatsheet/labels-merge-mouse branch from 6a1985d to c114a1d Compare October 2, 2026 19:44
@ajgringo619

Copy link
Copy Markdown

Wouldn't using HYPR make more sense?

@drshade

drshade commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Wouldn't using HYPR make more sense?

Yes! This change introduces configuration with “Hyper” being the default for MOD3 (to match “Super”). But if you wanted “HYPR” and “SUPR” thats two lines of configuration to achieve.

@Jteve-Sobs

Copy link
Copy Markdown

What do you think about this?
grafik
I am thinking about finalizing the code for that
As it also effects your changes I wanted to ask about input
Maybe also add symbols for mouse wheel scrolling or media keys

@ItsLemmy
ItsLemmy marked this pull request as ready for review October 6, 2026 00:44
@ItsLemmy
ItsLemmy merged commit e5e85ab into noctalia-dev:main Oct 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants