pingdotgg / pingdotgg/t3code

[Bug]: Hyprland shortcut setup rejects its existing Lua binding

Open
#10,657 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accepted bug via-triage
Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/desktop

Steps to reproduce
  1. On Omarchy with Hyprland 0.56.2 and Lua configuration, finish SnapShots setup using Ctrl+Shift+2.
  2. Confirm the shortcut captures a window.
  3. Reopen Settings > SnapShots > Change shortcut.
  4. Keep the existing shortcut and click Review changes.
Expected behavior

Setup recognizes the installed shortcut and shows "This shortcut is already set up." Done should complete without rewriting or reloading the config.

Actual behavior

Review changes fails with "Couldn't prepare the changes. Check Advanced for help." Advanced shows a generic DesktopSnapShotSetupError. The underlying preview rejects the existing shortcut as already used by Hyprland.

Hyprland reports Lua bindings as dispatcher: "__lua" with a numeric callback argument. The existing binding is:

hl.bind("CTRL + SHIFT + 2", hl.dsp.global("com.t3tools.T3Code:capture-window"))

CaptureShortcutConfig.checkHyprlandKeys exempts only a global dispatcher with the capture action. It consequently rejects the app's own Lua binding even when editCaptureConfig has already found that no config change is needed. The same check runs again during apply.

Reproduced through the unchanged preview API using the current user config and live hyprctl -j binds, and confirmed in the desktop setup dialog. No config writes are needed to reproduce it.

Impact

Minor bug or occasional failure. Reopening setup fails; the already configured capture shortcut continues to work.

Version or commit

main @ a01b227d6. Introduced with #8103.

Environment

Omarchy 4 development branch; Hyprland 0.56.2; native Wayland; Lua config in the user bindings file.

Workaround

Close setup and keep using the existing shortcut. Changing to a different unused shortcut still works.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with CaptureShortcutConfig.checkHyprlandKeys and editCaptureConfig, then trace the unchanged preview API and the apply path using the live hyprctl -j binds data described in the issue. Update handling so the app's existing Lua binding is recognized during both preview and apply, with no config rewrite or reload required, and verify that reopening setup reports the shortcut as already configured.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, lua, typescript
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.