Skip to content

Migrate Hyprland config from hyprlang to Lua - #259

Closed
binarypie wants to merge 1 commit into
mainfrom
claude/hyperland-lua-migration-o03ltj
Closed

binarypie wants to merge 1 commit into
mainfrom
claude/hyperland-lua-migration-o03ltj

Conversation

@binarypie

Copy link
Copy Markdown
Collaborator

Summary

Hyprland 0.55 deprecates the hyprlang (.conf) config format in favor of Lua (~/.config/hypr/hyprland.lua). This PR ports the Hypercube compositor configs to the new Lua API, per the Lua-ification blog post and the updated wiki.

Changes

  • dot_files/hypr/hyprland.conf → hyprland.lua — full port of the Tokyo Night config:
    • hl.monitor(...), autostart via hl.on("hyprland.start", ...) + hl.exec_cmd(...)
    • environment via hl.env(...) (SSH agent socket built with os.getenv("XDG_RUNTIME_DIR"))
    • look & feel via hl.config({ general = {...}, decoration = {...}, animations = {...} }) with gradient/colour tables
    • animation curves via hl.curve(...) and hl.animation({ leaf = ..., bezier/spring = ... })
    • input/gestures/per-device via hl.config({ input = ... }), hl.gesture(...), hl.device(...)
    • keybinds via hl.bind(keys, hl.dsp.*, { flags }) — vim navigation, workspace loop, media/brightness OSD binds (locked/repeating flags), mouse binds
    • window/layer rules via hl.window_rule(...) / hl.layer_rule(...)
  • dot_files/hypr/hyprland-kiosk.conf → hyprland-kiosk.lua — kiosk-mode port (locked-down, single fullscreen app).
  • dot_files/hypr/.luarc.json — recommended Lua-LSP config so the hl API stubs from /usr/share/hypr/stubs load for manual editing.
  • build_files/hypercube/03-hypercube-configs.sh — the /etc/skel stub now writes hyprland.lua and require()s the system config instead of the old hyprlang source = directive.
  • iso_files/hook-post-rootfs.sh — the live-ISO overlay now appends Lua to hyprland.lua.
  • Docs/comments — updated the CONTRIBUTING.md file tree and the dark-mode dconf note.

Notes

  • hypridle.conf, hyprlock.conf, and hyprpaper.conf are intentionally left as hyprlang — those Hypr ecosystem tools still use hyprlang; only the compositor moved to Lua.
  • Both .lua files pass luac5.4 -p syntax checks and run cleanly through a mock hl API (exercising the workspace loop, string concatenation, and os.getenv); .luarc.json is valid JSON.

Test plan

  • Build the image and confirm /usr/share/hypercube/config/hypr/hyprland.lua is present and the /etc/skel stub require()s it.
  • Boot and verify the compositor starts, keybinds, animations, gestures, and quickshell layer rules behave as before.
  • Verify the live ISO auto-launches the installer with the Anaconda window rules applied.

🤖 Generated with Claude Code

https://claude.ai/code/session_01T97eCv6imHgfkVWxqBJrmH


Generated by Claude Code

Hyprland 0.55 deprecates the hyprlang (.conf) config format in favor of
Lua (~/.config/hypr/hyprland.lua). Port the Hypercube compositor configs
to the new API.

- Convert hyprland.conf -> hyprland.lua (monitors, autostart via
  hl.on("hyprland.start"), env, look-and-feel via hl.config(), curves and
  animations, input, gestures, per-device config, keybinds via hl.bind() /
  hl.dsp.*, window/layer rules).
- Convert hyprland-kiosk.conf -> hyprland-kiosk.lua.
- Add recommended .luarc.json so the Lua LSP loads Hyprland's stubs from
  /usr/share/hypr/stubs for manual editing.
- Update the /etc/skel stub to require() the system Lua config instead of
  the old hyprlang `source =` directive.
- Update the live-ISO hook to append Lua to hyprland.lua.
- Update doc/comment references (CONTRIBUTING.md tree, dark-mode note).

hypridle/hyprlock/hyprpaper remain hyprlang (.conf); those Hypr ecosystem
tools still use hyprlang, only the compositor moved to Lua.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T97eCv6imHgfkVWxqBJrmH
binarypie added a commit that referenced this pull request Oct 27, 2026
…346)

Rolls the 62 open `package-update` PRs and the Lua migration draft
(#259) into one change, so COPR builds one consistent set and the image
is rebuilt once.

## Package upgrades

Each package takes the newest version among its open PRs (checked
against upstream tags).

| Package | From | To | Supersedes |
| --- | --- | --- | --- |
| aquamarine | 0.14.0 | **0.15.1** | #343, #310, #301, #297, #290 |
| hyprutils | 0.14.0 | **0.14.3** | (same group PRs), #288 |
| hyprland | 0.56.1 | **0.56.2** | (same group PRs), #288 |
| hyprtoolkit | 0.5.4 | **0.6.0** | #343, #310, #301 |
| hyprpolkitagent | 0.1.3 | **0.2.0** | #343, #310, #301 |
| hyprland-protocols | 0.7.0 | **0.8.0** | #337, #307 |
| lua55 | 5.5.0 | **5.5.1** | #303, #297, #290, #288 |
| quickshell | 0.3.0 | **0.3.2** | #329 |
| uwsm | 0.26.6 | **0.27.1** | #335, #308, #284 |
| resterm | 0.49.3 | **1.16.1** | #344, #340, #336, #334, #331, #330,
#327, #326, #324, #322, #321, #320, #319, #318, #317, #316, #311, #309,
#300, #299, #296, #295, #294, #292, #291, #287, #286, #285 |
| lazygit | 0.63.1 | **0.66.2** | #338, #332, #325, #305, #298 |
| lazysql | 0.5.5 | **0.7.0** | #333, #323, #314, #313, #304, #283 |
| iamb | 0.0.11 | **0.13.1** | #342, #341, #312 (upstream jumped from
0.0.13 to 0.13.1) |
| starship | 1.26.0 | **1.27.0** | #339 |
| bluetui | 0.8.1 | **0.8.2** | #328 |
| resvg | 0.47.0 | **0.49.0** | #345 |
| yazi | 26.5.6 | **26.9.1** | #293 |
| zellij | 0.44.3 | **0.45.1** | #289 |
| hyprpaper | 0.8.4-3 | **0.8.4-4** | rebuild only |
| hyprland-guiutils | 0.2.2-2 | **0.2.2-3** | rebuild only |

### Not upgraded: glaze stays on 7.9.1
Hyprland 0.56.2 requires glaze 7.x (`find_package(glaze 7...<8)` in its
CMakeLists), so the glaze 8.x/9.x PRs (#315, #306, #302, and the glaze
bumps inside #297, #290, #288) would break the Hyprland build. 7.9.1 is
already the newest 7.x. I added `VERSION_PINS` to
`scripts/packages/config.sh` so the daily checker only proposes glaze
7.x from now on.

### Fixes the version-only bot bumps were missing
- **aquamarine** SONAME 13 → 14 and **hyprtoolkit** SONAME 5 → 6: the
hardcoded `.so.N` in `%files` would have failed packaging. hyprpaper and
hyprland-guiutils get a release bump so they rebuild against the new
libraries.
- **hyprtoolkit 0.6.0** adds a dependency on abseil
(`absl_flat_hash_map`); BuildRequires added.
- **hyprpolkitagent 0.2.0** is a rewrite on hyprtoolkit with no Qt. The
spec now uses a bundled static sdbus-cpp (same approach as hypridle) and
`Requires: polkit` for the auth helper. Moved to build batch 5, after
hyprtoolkit.
- **lua55 5.5.1** already contains the fixes from the
`lua-5.5.0-bug1/bug2` patches: bug1 no longer applies and bug2 is
detected as reversed, so `%prep` would have failed. Patches dropped.
- **iamb / yazi / starship**: the new releases need Rust 1.96 / 1.95 /
1.95. Raised `rust >=` so a toolchain gap fails clearly.

## Hyprland Lua migration

Includes #259's port of `hyprland.conf` / `hyprland-kiosk.conf` to Lua,
plus:

- **`hyprctl dispatch` callers.** With a Lua config, `hyprctl dispatch
X` is evaluated as `hl.dispatch(X)`, so the old hyprlang syntax is a Lua
error. Fixed:
- hypridle: `dpms off/on` → `hl.dsp.dpms({ action = ... })`. Without
this, screens never blank or wake on idle.
- quickshell app switcher: `focuswindow` → `hl.dsp.focus({ window = ...
})`
  - quickshell logout: `exit` → `hl.dsp.exit()`
- **Existing users.** Hyprland now picks the system `hyprland.lua` over
a user's old `~/.config/hypr/hyprland.conf` stub, silently dropping
their tweaks. Migration `003-hyprland-lua-user-config.sh` writes the Lua
stub for users who don't have one, carries any custom hyprlang lines
over as comments to port, and never touches symlinked or existing Lua
configs.
- `.luarc.json` is installed into `~/.config/hypr` so editors find the
`hl` API stubs.

### How the configs were checked
There is no Hyprland session in CI, so I wrote a validator that reads
the 0.56.2 C++ source (config keys, window/layer rule fields and match
properties, dispatchers and their args, events). It then runs each
config through a strict mock `hl`. It passes for `hyprland.lua`,
`hyprland-kiosk.lua`, the live-ISO config with its appended block, and
the `/etc/skel` stub. I seeded it with typos to confirm it catches bad
keys, fields, args, events and API names. A keybinding diff against the
old `.conf` shows the same 66 bindings.

## Test plan
- [ ] COPR PR build is green for all changed packages
- [ ] Image build passes `99-tests.sh`
- [ ] Boot: Hyprland starts on the Lua config; keybinds, quickshell,
hyprpaper, hypridle (screen blank and wake), polkit prompt
- [ ] Upgrade an existing install: migration 003 writes
`~/.config/hypr/hyprland.lua` and custom lines show up commented
- [ ] Live ISO launches the installer with the Anaconda window rules

After merge, the superseded PRs listed above and #259 can be closed.

---
_Generated by [Claude
Code](https://claude.ai/code/session_015S2eLxUcy5sGRvu1X8TmFk)_

---------

Co-authored-by: Claude <noreply@anthropic.com>

Copy link
Copy Markdown
Collaborator Author

Included in #346 (merged), which carried this Lua port forward plus the follow-up fixes (Lua hyprctl dispatch syntax for hypridle/quickshell, and a migration for existing users' hyprland.conf stubs). Closing.


Generated by Claude Code

@binarypie binarypie closed this Oct 27, 2026
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.

2 participants