Skip to content

#1891 docs: describe the Lua keybind configuration and add a transition guide - #1892

Open
RAprogramm wants to merge 2 commits into
HyDE-Project:devfrom
RAprogramm:1891
Open

#1891 docs: describe the Lua keybind configuration and add a transition guide#1892
RAprogramm wants to merge 2 commits into
HyDE-Project:devfrom
RAprogramm:1891

Conversation

@RAprogramm

@RAprogramm RAprogramm commented Jul 30, 2026

Copy link
Copy Markdown

Closes #1891

Customization section

KEYBINDINGS.md:290-311 told users to edit ~/.config/hypr/userprefs.conf, deleted by 6eb07e2d, with an ini-fenced hyprlang example using $mainMod, and walked through creating a game-launcher bind that already ships as SUPER + SHIFT + G. Replaced with what the code does:

  • your file is ~/.config/hypr/hyprland.lua, deployed preserve (Scripts/dots/hyprland.toml:23-27); HyDE's own binds are in ~/.local/share/hypr/lua/key_binds.lua, deployed sync (:11-16)
  • your file loads after HyDE's binds (Configs/.local/share/hypr/hyde.lua:53,59); the selected workflow loads after it (:61) and can override compositor settings
  • overriding works through the hl.bind wrapper (lua/hyde/binds.lua:158-179) with dedup enabled before the first bind (key_binds.lua:6)
  • the flag trap: a collision is keyed on the canonical combo plus the 14 flags in hyde.binds.dedup_fields (binds.lua:131-148), and description is not one of them. Thirty-three shipped binds carry a flag, so an override that copies the combo but not the flags leaves both binds live. Tabulated by flag, including the six that carry locked and repeating
  • hl.unbind takes the registered string with single spaces around +, and several binds are written with CONTROL where CTRL would be expected (key_binds.lua:140,142,144,146,217,236,242,307,309,312,330,334) — so the advice is to rebind rather than unbind
  • hyde.sh.<name>() builds a hyde-shell command, but 25 names are remapped through hyde.command_map (lua/hyde/dispatcher.lua:148-177), which is now stated rather than implied

Descriptions corrected

Row Was Now
SUPER + Delete kill hyprland session exit hyprland session (hl.dsp.exit(), key_binds.lua:71)
SHIFT + F11 toggle fullscreen cycle fullscreen states — (n+1) % 3 at key_binds.lua:16-29
SUPER + CTRL + B toggle waybar and reload config toggle waybar — waybar.py:1246-1249 sends SIGUSR1, there is no config reload
ALT + Tab cycle focus (under "Change focus") its own section: the switcher overlay, with ALT + SHIFT + Tab and the hold-to-keep-open behaviour (key_binds.lua:114-120, altab.lua:22-24)

Binds documented for the first time

SUPER + ALT + F4 kill window, ALT + P pseudotile, ALT + SHIFT + Tab, SUPER + SHIFT + K calculator, SUPER + SHIFT + slash web search, SUPER + SHIFT + G game launcher, SUPER + CTRL + M mute focused window, SUPER + CTRL + S OCR, and the numpad workspaces 11-20 in both directions — with a note that each numpad key is bound under both keysyms it can emit, so the binds work with Num Lock either way (key_binds.lua:275-304, 319-327).

Two rows are placed by the group their description declares, not by where they look like they belong: SUPER + CTRL + M under Hardware Controls → Media (key_binds.lua:216) and SUPER + SHIFT + G under Utilities (:228), because that is where SUPER + / will show them.

The keybinding hint section now says the list is cached and refreshed on close, so the first press after adding a bind can still show the previous list.

Transition guide

MIGRATION-LUA.md is new. Nobody wrote one — discussion #1734 asked for it in May and the last message in the thread is still "I am just looking for a transition guide". It covers what moved where, the upgrade command and the install.sh -p recovery path for #1878, a symptom table for the silent failures (#1849 TTY entry point, #1852 missing runtime, #1840 colours, #1854 shadowing scripts, #1824 stale hint cache, #1864 carried-over state), the orphaned files the upgrade leaves behind, and the two orphan sets that are not harmless — the removed systemd units and the old shell completions. Every command in it was checked against the code before it went in.

Also

  • Configs/.config/hypr/hyprland.lua: the stub said "refer to the wiki" — there is no wiki — and carried two typos. Now shows a working bind, the flag caveat and where the defaults live.
  • Hyprdots-to-HyDE.md: the paragraph describing the userprefs/source = model, and the diagram of it.
  • Broken keybinding links in the German, Arabic, French, Dutch and Turkish readmes: those files live under Source/assets/keybinds/, not next to the readme.
  • tests/lua/bind_harness.lua: eight entries added to required_defaults so the newly documented binds cannot silently move. Verified non-vacuous by renaming each target and confirming eight failures.

Not in this PR

The seven translated keybinding references still carry the pre-Lua customization section and two binds that no longer exist (CTRL + Q, ALT + Control_R). I started annotating them and reverted it: the repository's habit is to synchronize translations or leave them alone, and a note on one section would have implied the rest of each file was current. They need a translation pass, tracked in #1891.

Full suite: 8 cases, 0 failed.

Summary by CodeRabbit

  • Documentation
    • Added MIGRATION-LUA.md with upgrade steps and common recovery commands for moving from legacy Hyprland .conf to Lua.
    • Replaced the Hyprland Lua configuration template with expanded, documented guidance on precedence and keybind overrides.
    • Overhauled KEYBINDINGS.md with new/clarified shortcuts, workspace navigation (including numpad), and updated customization instructions.
    • Fixed navigation links for translated docs and improved CHANGELOG.md entries.
  • Tests
    • Expanded the Lua keybind documentation validation list.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 25d5d021-bad5-4906-8639-ca6cd0adca1b

📥 Commits

Reviewing files that changed from the base of the PR and between 647d7fc and da0b9d7.

📒 Files selected for processing (3)
  • Configs/.config/hypr/hyprland.lua
  • Hyprdots-to-HyDE.md
  • MIGRATION-LUA.md
🚧 Files skipped from review as they are similar to previous changes (3)
  • Hyprdots-to-HyDE.md
  • Configs/.config/hypr/hyprland.lua
  • MIGRATION-LUA.md

📝 Walkthrough

Walkthrough

The PR documents HyDE’s migration to Lua configuration, expands the keybinding reference and validation coverage, updates configuration templates, and fixes translated README links and changelog entries.

Changes

Lua configuration and migration

Layer / File(s) Summary
Lua configuration ownership and migration
MIGRATION-LUA.md, Configs/.config/hypr/hyprland.lua, Hyprdots-to-HyDE.md
Documents the Lua entry point, upgrade procedure, orphan files, user configuration location, load order, and override examples.
Keybinding reference and customization guidance
KEYBINDINGS.md
Corrects binding descriptions, adds shortcuts and workspace mappings, and replaces legacy userprefs.conf guidance with Lua customization instructions.
Documented binding validation
tests/lua/bind_harness.lua
Expands required documented key combinations checked by the Lua binding harness.
Documentation navigation and changelog
CHANGELOG.md, Source/docs/README.{ar,de,fr,nl,tr}.md
Adds changelog entries and updates translated README links to keybinding documents.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels: enhancement

Poem

A rabbit hops through Lua’s new door,
With keybinds mapped and docs galore.
Old paths fade beneath the moon,
New shortcuts dance to a carrot tune.
“Update!” cries Bunny—“the links are right!”

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main documentation work: Lua keybind configuration guidance plus a transition guide.
Linked Issues check ✅ Passed The PR updates the Lua keybind docs, migration guide, stale links, bind descriptions, and live-bind guidance requested by #1891.
Out of Scope Changes check ✅ Passed The changes stay within the documentation, migration, and test-harness updates needed for the Lua keybind transition.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 15: Update the Hyprland changelog entry to replace the ambiguous “legacy
hyprlang dot” wording with “legacy hyprlang dotfiles” or “legacy hyprlang
configuration files,” while preserving the existing statement about the removed
deployed files.

In `@Configs/.config/hypr/hyprland.lua`:
- Around line 1-5: Update the introductory bind-override wording in
Configs/.config/hypr/hyprland.lua lines 1-5 and the corresponding documentation
in KEYBINDINGS.md lines 319-323 to state that user binds replace HyDE binds only
when the key/modifier combination and relevant flags match; do not imply load
order alone disables the default bind.

In `@Hyprdots-to-HyDE.md`:
- Around line 70-75: Revise the configuration-separation explanation to describe
only its ownership and overwrite guarantees. Remove claims that the split
prevents HyDE or user configurations from breaking each other, and acknowledge
that invalid or incompatible user settings and required migrations may still
affect session startup.

In `@MIGRATION-LUA.md`:
- Around line 47-50: Update the Hyprland command in the troubleshooting table to
use the documented default data directory when XDG_DATA_HOME is unset, while
preserving the existing XDG_DATA_HOME path when it is set.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c05f176a-d9c1-4bd9-ab5e-6fcfdc5bb5de

📥 Commits

Reviewing files that changed from the base of the PR and between bab9fcf and 647d7fc.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • Configs/.config/hypr/hyprland.lua
  • Hyprdots-to-HyDE.md
  • KEYBINDINGS.md
  • MIGRATION-LUA.md
  • Source/docs/README.ar.md
  • Source/docs/README.de.md
  • Source/docs/README.fr.md
  • Source/docs/README.nl.md
  • Source/docs/README.tr.md
  • tests/lua/bind_harness.lua

Comment thread CHANGELOG.md
- Docs: `MIGRATION-LUA.md`, a transition guide for upgrading from the hyprlang configuration — what moved where, the silent failures and their causes, and the files the upgrade leaves behind

### Removed
- Hyprland: dropped the legacy hyprlang dot, the files it deployed no longer exist

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Clarify “legacy hyprlang dot”.

This appears to be a typo or ambiguous shorthand. Use “legacy hyprlang dotfiles” or “legacy hyprlang configuration files” so the removed artifacts are clear.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@CHANGELOG.md` at line 15, Update the Hyprland changelog entry to replace the
ambiguous “legacy hyprlang dot” wording with “legacy hyprlang dotfiles” or
“legacy hyprlang configuration files,” while preserving the existing statement
about the removed deployed files.

Comment thread Configs/.config/hypr/hyprland.lua Outdated
Comment on lines +1 to +5
-- Your Hyprland configuration. HyDE never overwrites this file.
--
-- It loads after HyDE's own binds, so anything here wins over them. HyDE's
-- defaults live in ~/.local/share/hypr/lua/ and are overwritten on every
-- update, so edits there do not survive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Document bind replacement as conditional on matching flags.

Both locations imply that user load order alone overrides HyDE binds, but the documented behavior requires matching combinations and flags; otherwise both binds remain live.

  • Configs/.config/hypr/hyprland.lua#L1-L5: replace “anything here wins” with a conditional override statement.
  • KEYBINDINGS.md#L319-L323: replace “anything you write there wins” with the same flag-aware wording.
📍 Affects 2 files
  • Configs/.config/hypr/hyprland.lua#L1-L5 (this comment)
  • KEYBINDINGS.md#L319-L323
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Configs/.config/hypr/hyprland.lua` around lines 1 - 5, Update the
introductory bind-override wording in Configs/.config/hypr/hyprland.lua lines
1-5 and the corresponding documentation in KEYBINDINGS.md lines 319-323 to state
that user binds replace HyDE binds only when the key/modifier combination and
relevant flags match; do not imply load order alone disables the default bind.

Comment thread Hyprdots-to-HyDE.md Outdated
Comment thread MIGRATION-LUA.md
@RAprogramm

Copy link
Copy Markdown
Author

Three of the four addressed, one declined.

Unset XDG_DATA_HOME. Right, and it would have sent a TTY user to /hypr/hyde.lua. The guide now spells the fallback: Hyprland -c ${XDG_DATA_HOME:-$HOME/.local/share}/hypr/hyde.lua, matching what shell/activate resolves.

Override wording in the stub. Fair — load order alone gives precedence to settings, while replacing a bind additionally needs the combination and the flags to match. The opening line now says settings take precedence and points at the flag section rather than implying binds are covered too.

The no-breakage promise. Also fair, and the sentence was inherited from the paragraph I replaced. It now claims only what the split actually guarantees — an update cannot overwrite your settings and they cannot be lost with one — and states plainly that a Lua error in your own file will stop the session, and that a HyDE change may need a matching change there.

Also fixed while in there: the example in the guide used [Launcher|Apps] for the game launcher where the code declares [Utilities], and the load-order sentence omitted the workflow module that loads after the user's file.

Declined: "legacy hyprlang dot". "Dot" is this project's term for a deployable unit, not a typo — Scripts/dots/*.toml are the dot metafiles, deez dots --deploy is the command, and the entry removed was Scripts/dots/hyprland-legacy.toml. "Dotfiles" would be less accurate, since what went away is the metafile and the deployment, not a set of files in the repository. That line is also not from this PR — it came in with bab9fcf4.

Suite: 8 cases, 0 failed.

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.

1 participant